refs #3520 feat:refactorSilex→Salix
This commit is contained in:
parent
643d2dd994
commit
51d5bcf6ae
|
@ -49,6 +49,72 @@
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
</config>
|
</config>
|
||||||
</layout>
|
</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">
|
<layout url="file://$PROJECT_DIR$/app/src/main/res/layout/item_expeditionpallet_row.xml">
|
||||||
<config>
|
<config>
|
||||||
<theme>@style/AppTheme</theme>
|
<theme>@style/AppTheme</theme>
|
||||||
|
@ -116,15 +182,130 @@
|
||||||
</select>
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6607 feat:checking_boxes">
|
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #7278 feat:newUI SummaryFragment">
|
||||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivityViewModel.kt" afterDir="false" />
|
<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$/.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/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/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/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/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/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_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>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -138,7 +319,7 @@
|
||||||
<component name="CodeInsightWorkspaceSettings">
|
<component name="CodeInsightWorkspaceSettings">
|
||||||
<option name="optimizeImportsOnTheFly" value="true" />
|
<option name="optimizeImportsOnTheFly" value="true" />
|
||||||
</component>
|
</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">
|
<component name="ExportToHTMLSettings">
|
||||||
<option name="OPEN_IN_BROWSER" value="true" />
|
<option name="OPEN_IN_BROWSER" value="true" />
|
||||||
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
|
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
|
||||||
|
@ -230,7 +411,7 @@
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||||
<map>
|
<map>
|
||||||
<entry key="$PROJECT_DIR$" value="dev_updateAGP" />
|
<entry key="$PROJECT_DIR$" value="testBeta" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
@ -275,6 +456,10 @@
|
||||||
<option name="selectedTabId" value="CurrentFile" />
|
<option name="selectedTabId" value="CurrentFile" />
|
||||||
<option name="sortByName" value="true" />
|
<option name="sortByName" value="true" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="ProjectColorInfo">{
|
||||||
|
"customColor": "",
|
||||||
|
"associatedIndex": 3
|
||||||
|
}</component>
|
||||||
<component name="ProjectId" id="1rNnmCWH3aNvnQwcp2vPrEIlvP2" />
|
<component name="ProjectId" id="1rNnmCWH3aNvnQwcp2vPrEIlvP2" />
|
||||||
<component name="ProjectLevelVcsManager">
|
<component name="ProjectLevelVcsManager">
|
||||||
<ConfirmationsSetting value="2" id="Add" />
|
<ConfirmationsSetting value="2" id="Add" />
|
||||||
|
@ -300,8 +485,9 @@
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/view/View.java_SELECTED": "View",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/view/View.java_SELECTED": "View",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/CompoundButton.java_SELECTED": "CompoundButton",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/CompoundButton.java_SELECTED": "CompoundButton",
|
||||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/TextView.java_SELECTED": "TextView",
|
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-34/android/widget/TextView.java_SELECTED": "TextView",
|
||||||
|
"cf.first.check.clang-format": "false",
|
||||||
"cidr.known.project.marker": "true",
|
"cidr.known.project.marker": "true",
|
||||||
"com.developerphil.adbidea.selecteddevices": "21114523025303",
|
"com.developerphil.adbidea.selecteddevices": "23086B3FFD",
|
||||||
"com.google.services.firebase.aqiPopupShown": "true",
|
"com.google.services.firebase.aqiPopupShown": "true",
|
||||||
"git-widget-placeholder": "dev",
|
"git-widget-placeholder": "dev",
|
||||||
"last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout",
|
"last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout",
|
||||||
|
@ -309,7 +495,7 @@
|
||||||
"project.structure.proportion": "0.17",
|
"project.structure.proportion": "0.17",
|
||||||
"project.structure.side.proportion": "0.2",
|
"project.structure.side.proportion": "0.2",
|
||||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||||
"settings.editor.selected.configurable": "preferences.pluginManager"
|
"settings.editor.selected.configurable": "device.mirroring"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"ExportApk.BuildVariants": [
|
"ExportApk.BuildVariants": [
|
||||||
|
@ -345,11 +531,11 @@
|
||||||
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\font" />
|
<recent name="C:\Users\sergiodt\AndroidStudioProjects\vn-warehouseManager\app\src\main\res\font" />
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
|
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
|
||||||
|
<recent name="es.verdnatura.presentation.view.feature.claim.fragment.ubication" />
|
||||||
<recent name="es.verdnatura.presentation.view.feature.packingHolland.fragment" />
|
<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.packaging.fragment.SupplierViewModel" />
|
||||||
<recent name="es.verdnatura.presentation.view.feature.workermistake.fragment" />
|
<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.historicoshelving.fragment" />
|
||||||
<recent name="es.verdnatura.presentation.view.feature.buffer.fragment" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="CopyKotlinDeclarationDialog.RECENTS_KEY">
|
<key name="CopyKotlinDeclarationDialog.RECENTS_KEY">
|
||||||
<recent name="es.verdnatura.presentation.view.feature.main.activity" />
|
<recent name="es.verdnatura.presentation.view.feature.main.activity" />
|
||||||
|
@ -385,6 +571,7 @@
|
||||||
<option name="ALL_USERS" value="false" />
|
<option name="ALL_USERS" value="false" />
|
||||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||||
|
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||||
<option name="MODE" value="default_activity" />
|
<option name="MODE" value="default_activity" />
|
||||||
<option name="CLEAR_LOGCAT" value="false" />
|
<option name="CLEAR_LOGCAT" value="false" />
|
||||||
|
@ -458,6 +645,7 @@
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<RunAsTest>false</RunAsTest>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="JetRunConfigurationType">
|
<configuration default="true" type="JetRunConfigurationType">
|
||||||
|
@ -838,7 +1026,7 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1709725795643</updated>
|
<updated>1709725795643</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="275" />
|
<option name="localTasksCounter" value="276" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.History.Properties">
|
<component name="Vcs.Log.History.Properties">
|
||||||
|
@ -852,6 +1040,21 @@
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<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">
|
<option name="TAB_STATES">
|
||||||
<map>
|
<map>
|
||||||
<entry key="1">
|
<entry key="1">
|
||||||
|
@ -875,6 +1078,12 @@
|
||||||
<value>
|
<value>
|
||||||
<State>
|
<State>
|
||||||
<option name="BEK_SORT_TYPE" value="1" />
|
<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">
|
<option name="FILTERS">
|
||||||
<map>
|
<map>
|
||||||
<entry key="branch">
|
<entry key="branch">
|
||||||
|
@ -886,12 +1095,6 @@
|
||||||
</entry>
|
</entry>
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</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>
|
</State>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
|
@ -921,25 +1124,9 @@
|
||||||
</entry>
|
</entry>
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</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>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||||
<MESSAGE value="refs #6078feat:activityWorker" />
|
|
||||||
<MESSAGE value="refs #6531feat:showLastTickets" />
|
<MESSAGE value="refs #6531feat:showLastTickets" />
|
||||||
<MESSAGE value="refs #6440: errorNaturPhotos" />
|
<MESSAGE value="refs #6440: errorNaturPhotos" />
|
||||||
<MESSAGE value="refs #6651feat:itemShelving_get" />
|
<MESSAGE value="refs #6651feat:itemShelving_get" />
|
||||||
|
@ -964,7 +1151,8 @@
|
||||||
<MESSAGE value="version 24.5Beta" />
|
<MESSAGE value="version 24.5Beta" />
|
||||||
<MESSAGE value="version 24.8Beta" />
|
<MESSAGE value="version 24.8Beta" />
|
||||||
<MESSAGE value="refs #6607 feat:checking_boxes" />
|
<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>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<pin-to-top-manager>
|
<pin-to-top-manager>
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 251,
|
"versionCode": 290,
|
||||||
"versionName": "24.2Beta",
|
"versionName": "24.20Beta",
|
||||||
"outputFile": "app-beta-release.apk"
|
"outputFile": "app-beta-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -13,8 +13,8 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
|
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
|
||||||
versionCode 285
|
versionCode 290
|
||||||
versionName = "24.18Beta"
|
versionName = "24.20Beta"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import androidx.datastore.preferences.preferencesDataStore
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.MobileApplication
|
import es.verdnatura.MobileApplication
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.domain.ConstAndValues
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
||||||
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
||||||
import es.verdnatura.domain.ConstAndValues.NUMBEROFWAGONS
|
import es.verdnatura.domain.ConstAndValues.NUMBEROFWAGONS
|
||||||
|
@ -160,7 +159,6 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"Producción",
|
"Producción",
|
||||||
"https://app.verdnatura.es",
|
|
||||||
"https://salix.verdnatura.es"
|
"https://salix.verdnatura.es"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -169,19 +167,18 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getWorkForm(): List<WorkForms> {
|
suspend fun getWorkForm(): List<WorkForms> {
|
||||||
var listForms: ArrayList<WorkForms> = ArrayList()
|
val listForms: ArrayList<WorkForms> = ArrayList()
|
||||||
val preferences = mobileApplication.dataStoreWork.data.first()
|
val preferences = mobileApplication.dataStoreWork.data.first()
|
||||||
|
|
||||||
preferences.asMap().forEach { entry ->
|
preferences.asMap().forEach { entry ->
|
||||||
val key = entry.key
|
val key = entry.key
|
||||||
val value = entry.value
|
val value = entry.value
|
||||||
|
|
||||||
var json2 = JSONObject(value.toString())
|
val json2 = JSONObject(value.toString())
|
||||||
|
|
||||||
listForms.add(
|
listForms.add(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
key.name,
|
key.name,
|
||||||
json2.get("urlSilex").toString(),
|
|
||||||
json2.get("urlSalix").toString(),
|
json2.get("urlSalix").toString(),
|
||||||
json2.get("isShowDelete").toString().toBoolean(),
|
json2.get("isShowDelete").toString().toBoolean(),
|
||||||
json2.get("created") as Long
|
json2.get("created") as Long
|
||||||
|
@ -199,27 +196,24 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
return listForms.sortedBy { it.created }
|
return listForms.sortedBy { it.created }
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun createWorksDefault() {
|
private suspend fun createWorksDefault() {
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"Producción",
|
"Producción",
|
||||||
"https://app.verdnatura.es",
|
|
||||||
"https://salix.verdnatura.es"
|
"https://salix.verdnatura.es"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"Test",
|
"Test",
|
||||||
"https://test-app.verdnatura.es",
|
|
||||||
urlSalix = "https://test-salix.verdnatura.es"
|
urlSalix = "https://test-salix.verdnatura.es"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
var working_in_test = true
|
val working_in_test = true
|
||||||
if (working_in_test) {
|
if (working_in_test) {
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"TestLocalhost",
|
"TestLocalhost",
|
||||||
"http://10.1.4.42:9000",
|
|
||||||
urlSalix = "https://test-salix.verdnatura.es"
|
urlSalix = "https://test-salix.verdnatura.es"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -227,28 +221,24 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"TestHome",
|
"TestHome",
|
||||||
"http://192.168.1.132:9000",
|
|
||||||
urlSalix = "https://test-salix.verdnatura.es"
|
urlSalix = "https://test-salix.verdnatura.es"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"TestLOCAL",
|
"TestLOCAL",
|
||||||
"http://10.1.4.42:9000",
|
|
||||||
urlSalix = "http://10.1.4.42:3000"
|
urlSalix = "http://10.1.4.42:3000"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"TestLOCALHOME",
|
"TestLOCALHOME",
|
||||||
"http://192.168.1.132:9000",
|
urlSalix = "http://192.168.1.139:3000"
|
||||||
urlSalix = "http://192.168.1.132:3000"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
saveWorkForm(
|
saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"DEV SALIX",
|
"DEV SALIX",
|
||||||
"http://10.1.4.42:9000",
|
|
||||||
urlSalix = "https://dev-salix.verdnatura.es"
|
urlSalix = "https://dev-salix.verdnatura.es"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -259,7 +249,7 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
WorkForms(
|
WorkForms(
|
||||||
mobileApplication.getString(R.string.addWorkForm),
|
mobileApplication.getString(R.string.addWorkForm),
|
||||||
"",
|
"",
|
||||||
"",
|
isShowDelete = false,
|
||||||
created = Calendar.getInstance().timeInMillis + Calendar.getInstance().timeInMillis
|
created = Calendar.getInstance().timeInMillis + Calendar.getInstance().timeInMillis
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -269,17 +259,14 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
|
|
||||||
suspend fun saveWorkForm(workForm: WorkForms) {
|
suspend fun saveWorkForm(workForm: WorkForms) {
|
||||||
|
|
||||||
var gson = Gson()
|
val gson = Gson()
|
||||||
var json = gson.toJson(workForm)
|
val json = gson.toJson(workForm)
|
||||||
mobileApplication.dataStoreWork.edit { preferences ->
|
mobileApplication.dataStoreWork.edit { preferences ->
|
||||||
preferences[stringPreferencesKey(workForm.name)] = json
|
preferences[stringPreferencesKey(workForm.name)] = json
|
||||||
}
|
}
|
||||||
|
|
||||||
runBlocking {
|
runBlocking {
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
ConstAndValues.BASEURL,
|
|
||||||
workForm.urlSilex
|
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
BASEURLSALIX,
|
BASEURLSALIX,
|
||||||
workForm.urlSalix
|
workForm.urlSalix
|
||||||
|
@ -292,7 +279,7 @@ class DataStoreLocal(var mobileApplication: MobileApplication) {
|
||||||
|
|
||||||
var url =
|
var url =
|
||||||
readDataStoreKey<String>(BASEURLSALIX)
|
readDataStoreKey<String>(BASEURLSALIX)
|
||||||
if (url.isNullOrBlank()) {
|
if (url.isBlank()) {
|
||||||
url = BASE_URL_SALIX
|
url = BASE_URL_SALIX
|
||||||
}
|
}
|
||||||
return url
|
return url
|
||||||
|
|
|
@ -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.articulo.fragment.ItemCardViewModel
|
||||||
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
|
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
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.collection.fragment.CollectionViewModel
|
||||||
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
|
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
|
||||||
|
|
|
@ -3,9 +3,7 @@ package es.verdnatura.domain
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.google.gson.GsonBuilder
|
import com.google.gson.GsonBuilder
|
||||||
import es.verdnatura.MobileApplication
|
import es.verdnatura.MobileApplication
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURL
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
||||||
import es.verdnatura.domain.ConstAndValues.BASE_URL
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
||||||
import es.verdnatura.presentation.common.InteceptorListener
|
import es.verdnatura.presentation.common.InteceptorListener
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
@ -41,20 +39,14 @@ class ApiSalixUtils {
|
||||||
var list = (context).dataStoreApp.getWorkForm()
|
var list = (context).dataStoreApp.getWorkForm()
|
||||||
for (l in list) {
|
for (l in list) {
|
||||||
if (l.name == myWorkFormSelected) {
|
if (l.name == myWorkFormSelected) {
|
||||||
context.dataStoreApp.editDataStoreKey(
|
|
||||||
BASEURL,
|
|
||||||
l.urlSilex
|
|
||||||
)
|
|
||||||
context.dataStoreApp.editDataStoreKey(BASEURLSALIX, l.urlSalix)
|
context.dataStoreApp.editDataStoreKey(BASEURLSALIX, l.urlSalix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
context.dataStoreApp.editDataStoreKey(
|
|
||||||
BASEURL,
|
|
||||||
BASE_URL
|
|
||||||
)
|
|
||||||
context.dataStoreApp.editDataStoreKey(
|
context.dataStoreApp.editDataStoreKey(
|
||||||
BASEURLSALIX,
|
BASEURLSALIX,
|
||||||
BASE_URL_SALIX
|
BASE_URL_SALIX
|
||||||
|
|
|
@ -52,10 +52,8 @@ object ConstAndValues {
|
||||||
const val ENTRYOBSERVATIONS = "ENTRYOBSERVATIONS"
|
const val ENTRYOBSERVATIONS = "ENTRYOBSERVATIONS"
|
||||||
const val ENTRYNUMBERIMAGES = "ENTRYNUMBERIMAGES"
|
const val ENTRYNUMBERIMAGES = "ENTRYNUMBERIMAGES"
|
||||||
const val ENTRYTYPE = "ENTRYTYPE"
|
const val ENTRYTYPE = "ENTRYTYPE"
|
||||||
const val BASEURL = "base_url"
|
|
||||||
const val BASEURLSALIX = "base_urlSalix"
|
const val BASEURLSALIX = "base_urlSalix"
|
||||||
const val BASE_URL_SALIX = "https://salix.verdnatura.es"
|
const val BASE_URL_SALIX = "https://salix.verdnatura.es"
|
||||||
const val BASE_URL = "https://app.verdnatura.es"
|
|
||||||
const val ENTRY = "ENTRY"
|
const val ENTRY = "ENTRY"
|
||||||
const val RENEWINTERVAL = "renewInterval"
|
const val RENEWINTERVAL = "renewInterval"
|
||||||
const val RENEWPERIOD = "renewPeriod"
|
const val RENEWPERIOD = "renewPeriod"
|
||||||
|
|
|
@ -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.articulo.model.ItemProposal
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
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.SalixSaleQuantity
|
||||||
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
|
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
|
||||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
|
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.ItemPalletViewVO
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
||||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
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.CollectionTicket
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
|
@ -224,12 +224,6 @@ interface SalixService {
|
||||||
@Query("schema") schema: String = "vn"
|
@Query("schema") schema: String = "vn"
|
||||||
): Call<List<ItemHistoricoVO>>
|
): Call<List<ItemHistoricoVO>>
|
||||||
|
|
||||||
@POST("Applications/itemTrash/execute-proc")
|
|
||||||
fun itemTrash(
|
|
||||||
@Query("params") params: Any? = null,
|
|
||||||
@Query("schema") schema: String = "vn"
|
|
||||||
): Call<Any>
|
|
||||||
|
|
||||||
@POST("workerActivities")
|
@POST("workerActivities")
|
||||||
fun workerActivityAdd(
|
fun workerActivityAdd(
|
||||||
@Body workerActionSalix: WorkerActionSalix
|
@Body workerActionSalix: WorkerActionSalix
|
||||||
|
@ -293,12 +287,12 @@ interface SalixService {
|
||||||
@Query("schema") schema: String = "vn"
|
@Query("schema") schema: String = "vn"
|
||||||
): Call<Unit>
|
): Call<Unit>
|
||||||
|
|
||||||
@GET("ExpeditionPallets/getPallet")//REVISADA
|
@GET("ExpeditionPallets/getPallet")
|
||||||
fun expeditionPalletGetPallet(
|
fun expeditionPalletGetPallet(
|
||||||
@Query("expeditionFk") expeditionFk: Number,
|
@Query("expeditionFk") expeditionFk: Number,
|
||||||
): Call<ItemExpeditionTruckVO>
|
): Call<ItemExpeditionTruckVO>
|
||||||
|
|
||||||
@GET("ExpeditionPallets")//REVISADA
|
@GET("ExpeditionPallets")
|
||||||
fun expeditionPalletGet(
|
fun expeditionPalletGet(
|
||||||
@Query("filter") filter: Any?,
|
@Query("filter") filter: Any?,
|
||||||
): Call<List<ItemExpeditionTruckSalix>>
|
): Call<List<ItemExpeditionTruckSalix>>
|
||||||
|
@ -309,7 +303,7 @@ interface SalixService {
|
||||||
):
|
):
|
||||||
Call<List<Printers>>
|
Call<List<Printers>>
|
||||||
|
|
||||||
@GET("Collections/getSales")//REVISADA
|
@GET("Collections/getSales")
|
||||||
fun getSalesFromTicketOrCollection(
|
fun getSalesFromTicketOrCollection(
|
||||||
@Query("collectionOrTicketFk") collectionOrTicketFk: Number,
|
@Query("collectionOrTicketFk") collectionOrTicketFk: Number,
|
||||||
@Query("print") print: Boolean,
|
@Query("print") print: Boolean,
|
||||||
|
@ -317,14 +311,14 @@ interface SalixService {
|
||||||
|
|
||||||
):
|
):
|
||||||
Call<CollectionVO>
|
Call<CollectionVO>
|
||||||
@GET("TicketCollections/hasUncheckedTicket")//REVISADA
|
@GET("TicketCollections/hasUncheckedTicket")
|
||||||
fun hasUncheckedTicket(
|
fun hasUncheckedTicket(
|
||||||
@Query("ticketFk") ticketFk: Number,
|
@Query("ticketFk") ticketFk: Number,
|
||||||
|
|
||||||
):
|
):
|
||||||
Call<String>
|
Call<String>
|
||||||
|
|
||||||
@POST("SaleTrackings/setPicked")//REVISADA
|
@POST("SaleTrackings/setPicked")
|
||||||
fun saleTrackingMark(
|
fun saleTrackingMark(
|
||||||
@Body saleTRackingSalix: SaleTrackingSalix
|
@Body saleTRackingSalix: SaleTrackingSalix
|
||||||
):
|
):
|
||||||
|
@ -337,7 +331,7 @@ interface SalixService {
|
||||||
):
|
):
|
||||||
Call<List<PreSacadorItemVO>>
|
Call<List<PreSacadorItemVO>>
|
||||||
|
|
||||||
@POST("Tickets/addSaleByCode")//REVISADA
|
@POST("Tickets/addSaleByCode")
|
||||||
fun addSaleByCode(
|
fun addSaleByCode(
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
):
|
):
|
||||||
|
@ -353,43 +347,43 @@ interface SalixService {
|
||||||
):
|
):
|
||||||
Call<Int>
|
Call<Int>
|
||||||
|
|
||||||
@POST("ItemShelvings/updateFromSale")//REVISADA
|
@POST("ItemShelvings/updateFromSale")
|
||||||
fun itemShelvingUpdateFromSale(
|
fun itemShelvingUpdateFromSale(
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
@POST("SaleTrackings/delete")//REVISADA
|
@POST("SaleTrackings/delete")
|
||||||
fun saleTrackingDel(
|
fun saleTrackingDel(
|
||||||
@Body params: SaleTrackingDelSalix
|
@Body params: SaleTrackingDelSalix
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
@POST("Shelvings/addLog")//REVISADA
|
@POST("Shelvings/addLog")
|
||||||
fun shelvingLogAdd(
|
fun shelvingLogAdd(
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
@POST("ItemShelvings/upsertItem")//REVISADA
|
@POST("ItemShelvings/upsertItem")
|
||||||
fun upsertItem(
|
fun upsertItem(
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
@POST("MachineWorkers/updateInTime")//REVISADA
|
@POST("MachineWorkers/updateInTime")
|
||||||
fun machineWorkerUpdateInTime(
|
fun machineWorkerUpdateInTime(
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
@POST("MachineWorkers/add")//REVISADA
|
@POST("MachineWorkers/add")
|
||||||
fun machineWorkerAdd(
|
fun machineWorkerAdd(
|
||||||
@Query("plate") plate: Any
|
@Query("plate") plate: Any
|
||||||
):
|
):
|
||||||
Call<Any>
|
Call<Any>
|
||||||
|
|
||||||
@POST("SaleTrackings/updateTracking")//REVISADA
|
@POST("SaleTrackings/updateTracking")
|
||||||
fun saleTrackingUpdate(
|
fun saleTrackingUpdate(
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
):
|
):
|
||||||
|
@ -407,7 +401,7 @@ interface SalixService {
|
||||||
):
|
):
|
||||||
Call<ArrayList<Reubication>>
|
Call<ArrayList<Reubication>>
|
||||||
|
|
||||||
@GET("MobileAppVersionControls/getVersion")//REVISADA
|
@GET("MobileAppVersionControls/getVersion")
|
||||||
fun getVersion(
|
fun getVersion(
|
||||||
@Query("app") app: String
|
@Query("app") app: String
|
||||||
):
|
):
|
||||||
|
@ -845,23 +839,23 @@ interface SalixService {
|
||||||
@Body parms: packingSiteSalix
|
@Body parms: packingSiteSalix
|
||||||
): Call<Unit>
|
): Call<Unit>
|
||||||
|
|
||||||
@PUT("ItemBarCodes")//REVISADA
|
@PUT("ItemBarCodes")
|
||||||
fun barcodesEdit(
|
fun barcodesEdit(
|
||||||
@Body params: ItemBarCodeSalix
|
@Body params: ItemBarCodeSalix
|
||||||
): Call<Any>
|
): Call<Any>
|
||||||
|
|
||||||
@DELETE("ItemBarcodes/delete")//REVISADA
|
@DELETE("ItemBarcodes/delete")
|
||||||
fun barcodesDelete(
|
fun barcodesDelete(
|
||||||
@Query("barcode") barcode: String,
|
@Query("barcode") barcode: String,
|
||||||
@Query("itemFk") itemFk: Int,
|
@Query("itemFk") itemFk: Int,
|
||||||
): Call<Any>
|
): Call<Any>
|
||||||
|
|
||||||
@GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA
|
@GET("ItemBarCodes/{barCodeValue}/toItem")
|
||||||
fun barcodes_toitem(
|
fun barcodes_toitem(
|
||||||
@Path("barCodeValue") barCodeValue: String
|
@Path("barCodeValue") barCodeValue: String
|
||||||
): Call<String?>
|
): Call<String?>
|
||||||
|
|
||||||
@GET("Suppliers")//REVISADA
|
@GET("Suppliers")
|
||||||
fun getSuppliers(
|
fun getSuppliers(
|
||||||
//@Query("filter") filter:String="""{"fields":{"id":true,"name":true}}"""
|
//@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}}}}]}""")
|
//@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>>*/
|
Call<List<EntrySalix>>*/
|
||||||
|
|
||||||
@PUT("Entries")//REVISADA
|
@PUT("Entries")
|
||||||
fun Entries(
|
fun Entries(
|
||||||
@Body supplier: Any
|
@Body supplier: Any
|
||||||
):
|
):
|
||||||
Call<List<EntrySalix>>
|
Call<List<EntrySalix>>
|
||||||
|
|
||||||
@GET("Entries")//REVISADA
|
@GET("Entries")
|
||||||
fun getEntries_fromSupplier(
|
fun getEntries_fromSupplier(
|
||||||
@Query("filter") filter: String
|
@Query("filter") filter: String
|
||||||
):
|
):
|
||||||
Call<List<EntrySalix>>
|
Call<List<EntrySalix>>
|
||||||
|
|
||||||
@GET("Entries")//REVISADA
|
@GET("Entries")
|
||||||
fun add_entry(
|
fun add_entry(
|
||||||
@Body entry: EntrySalix
|
@Body entry: EntrySalix
|
||||||
):
|
):
|
||||||
Call<EntrySalix>
|
Call<EntrySalix>
|
||||||
|
|
||||||
@PATCH("Entries/{entryId}")//REVISADA
|
@PATCH("Entries/{entryId}")
|
||||||
fun entry_updateObserv(
|
fun entry_updateObserv(
|
||||||
@Path("entryId") entryId: Int,
|
@Path("entryId") entryId: Int,
|
||||||
@Body entry: obervationEntry
|
@Body entry: obervationEntry
|
||||||
|
|
|
@ -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.ItemExpeditionTruckVO
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
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.CollectionTicket
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
||||||
|
|
|
@ -27,13 +27,12 @@ import com.bumptech.glide.request.transition.Transition
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import java.text.ParseException
|
import java.text.ParseException
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.Calendar
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) =
|
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) =
|
||||||
beginTransaction().func().commit()
|
beginTransaction().func().commit()
|
||||||
|
|
||||||
|
|
||||||
fun <T> Context.openActivity(it: Class<T>, extras: Bundle.() -> Unit = {}) {
|
fun <T> Context.openActivity(it: Class<T>, extras: Bundle.() -> Unit = {}) {
|
||||||
val intent = Intent(this, it)
|
val intent = Intent(this, it)
|
||||||
intent.putExtras(Bundle().apply(extras))
|
intent.putExtras(Bundle().apply(extras))
|
||||||
|
@ -170,7 +169,6 @@ fun Context.showKeyboardIn(view: View) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Extension function to change media volume programmatically
|
// Extension function to change media volume programmatically
|
||||||
fun AudioManager.setMediaVolume(volumeIndex: Int) {
|
fun AudioManager.setMediaVolume(volumeIndex: Int) {
|
||||||
// Set media volume level
|
// Set media volume level
|
||||||
|
@ -190,10 +188,11 @@ val AudioManager.mediaCurrentVolume: Int
|
||||||
get() = this.getStreamVolume(AudioManager.STREAM_MUSIC)
|
get() = this.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||||
|
|
||||||
fun getHourDay(date: String): String? {
|
fun getHourDay(date: String): String? {
|
||||||
val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
|
|
||||||
val cal = Calendar.getInstance()
|
|
||||||
return try {
|
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")
|
val f = DecimalFormat("00")
|
||||||
"" + f.format(cal[Calendar.HOUR_OF_DAY]) + ":" + f.format(cal[Calendar.MINUTE])
|
"" + f.format(cal[Calendar.HOUR_OF_DAY]) + ":" + f.format(cal[Calendar.MINUTE])
|
||||||
} catch (e: ParseException) {
|
} catch (e: ParseException) {
|
||||||
|
@ -210,7 +209,6 @@ fun addDateToTime(time: String): String {
|
||||||
return "$currentDate $time"
|
return "$currentDate $time"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): PackageInfo =
|
fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): PackageInfo =
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))
|
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))
|
||||||
|
|
|
@ -15,6 +15,7 @@ class CustomDialogInputThreeValues(context: Context) : Dialog(context, R.style.D
|
||||||
init {
|
init {
|
||||||
|
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
//binding.textinputlayoutThree.visibility = View.GONE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,8 +148,8 @@ class CustomDialogList(context: Context) : Dialog(context, R.style.DialogTheme)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideTextInput(): CustomDialogList {
|
fun hideTextInput(visibility:Int = View.INVISIBLE): CustomDialogList {
|
||||||
binding.textinputlayoutUsername.visibility = View.INVISIBLE
|
binding.textinputlayoutUsername.visibility = visibility
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,8 +86,11 @@ class AjustesFragment :
|
||||||
getString(R.string.closeSession) -> ma.onMyBackPressed()
|
getString(R.string.closeSession) -> ma.onMyBackPressed()
|
||||||
getString(R.string.printerLabel) -> {
|
getString(R.string.printerLabel) -> {
|
||||||
messagePrinter = getString(R.string.SelectPrinter)
|
messagePrinter = getString(R.string.SelectPrinter)
|
||||||
viewModel.printerGet(mobileApplication.dataStoreApp.readDataStoreKey(
|
viewModel.printerGet(
|
||||||
SECTORFK))
|
mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
|
SECTORFK
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(R.string.vehicleControl) -> ma.onPasillerosItemClickListener(
|
getString(R.string.vehicleControl) -> ma.onPasillerosItemClickListener(
|
||||||
|
@ -97,8 +100,8 @@ class AjustesFragment :
|
||||||
)
|
)
|
||||||
|
|
||||||
getString(R.string.menuByDefault) -> showMenuByDefault()
|
getString(R.string.menuByDefault) -> showMenuByDefault()
|
||||||
getString(R.string.settingsTitleItemPacking) -> viewModel.getItemPackingTypeSalix()
|
getString(R.string.settingsTitleItemPacking) -> if (item.action) viewModel.getItemPackingTypeSalix()
|
||||||
getString(R.string.settingsTitleTrain) -> viewModel.trainGet()
|
getString(R.string.settingsTitleTrain) -> if (item.action) viewModel.trainGet()
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
|
@ -108,14 +111,14 @@ class AjustesFragment :
|
||||||
|
|
||||||
workerAllowedResponse.observe(viewLifecycleOwner) {
|
workerAllowedResponse.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
isWorkerAllowed = it.response.toBoolean()
|
isWorkerAllowed = it
|
||||||
loginViewModel = LoginViewModel(context as MobileApplication)
|
loginViewModel = LoginViewModel(context as MobileApplication)
|
||||||
loginViewModel.operator_getDataSalix(mobileApplication.userId!!)
|
loginViewModel.operator_getDataSalix(mobileApplication.userId!!)
|
||||||
loginViewModel.workerOperator.observe(this@AjustesFragment) { iti ->
|
loginViewModel.workerOperator.observe(this@AjustesFragment) { iti ->
|
||||||
if (!iti.isError) {
|
if (!iti.isError) {
|
||||||
runBlocking { mobileApplication.dataStoreApp.saveDataOperator(iti) }
|
runBlocking { mobileApplication.dataStoreApp.saveDataOperator(iti) }
|
||||||
} else {
|
} 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 ->
|
loadActionUpdate.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
ma.messageWithSound(
|
|
||||||
if (it.isError) it.errorMessage else {
|
|
||||||
getString(R.string.itemUpdated)
|
|
||||||
}, it.isError, false
|
|
||||||
)
|
|
||||||
|
|
||||||
messagePrinter =
|
messagePrinter =
|
||||||
getString(R.string.SelectPrinter) + "\n" + getString(R.string.printerRemoved)
|
getString(R.string.SelectPrinter) + "\n" + getString(R.string.printerRemoved)
|
||||||
viewModel.printerGet(mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK))
|
viewModel.printerGet(mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK))
|
||||||
|
@ -194,13 +191,6 @@ class AjustesFragment :
|
||||||
}
|
}
|
||||||
loadPrintersList.observe(viewLifecycleOwner) { event ->
|
loadPrintersList.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull { it ->
|
event.getContentIfNotHandled().notNull { it ->
|
||||||
if (it.list.isNotEmpty() && it.list[0].isError) {
|
|
||||||
customDialog.setTitle(getString(R.string.error))
|
|
||||||
.setDescription(it.list[0].errorMessage)
|
|
||||||
.setOkButton(getString(R.string.Close)) {
|
|
||||||
customDialog.dismiss()
|
|
||||||
}.show()
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (it.list.isNotEmpty()) {
|
if (it.list.isNotEmpty()) {
|
||||||
val listPrinters: ArrayList<String> = ArrayList()
|
val listPrinters: ArrayList<String> = ArrayList()
|
||||||
|
@ -223,7 +213,6 @@ class AjustesFragment :
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
loadTrainList.observe(viewLifecycleOwner) { event ->
|
loadTrainList.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull { it ->
|
event.getContentIfNotHandled().notNull { it ->
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,7 @@ import es.verdnatura.MobileApplication
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.Event
|
import es.verdnatura.presentation.common.Event
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
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.Printers
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.model.PrintersList
|
import es.verdnatura.presentation.view.feature.ajustes.model.PrintersList
|
||||||
|
@ -35,16 +32,16 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val sectorList: LiveData<SectorListVO>
|
val sectorList: LiveData<SectorListVO>
|
||||||
get() = _sectorList
|
get() = _sectorList
|
||||||
|
|
||||||
private val _actionUpdate by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _actionUpdate by lazy { MutableLiveData<String>() }
|
||||||
val actionUpdate: LiveData<ResponseItemVO>
|
val actionUpdate: LiveData<String>
|
||||||
get() = _actionUpdate
|
get() = _actionUpdate
|
||||||
|
|
||||||
private val _printerList by lazy { MutableLiveData<PrintersList>() }
|
private val _printerList by lazy { MutableLiveData<PrintersList>() }
|
||||||
val printerList: LiveData<PrintersList>
|
val printerList: LiveData<PrintersList>
|
||||||
get() = _printerList
|
get() = _printerList
|
||||||
|
|
||||||
private val _workerAllowedResponse by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _workerAllowedResponse by lazy { MutableLiveData<Boolean>() }
|
||||||
val workerAllowedResponse: LiveData<ResponseItemVO>
|
val workerAllowedResponse: LiveData<Boolean>
|
||||||
get() = _workerAllowedResponse
|
get() = _workerAllowedResponse
|
||||||
|
|
||||||
private val _itemspackinglist by lazy { MutableLiveData<ItemPackingTypeList>() }
|
private val _itemspackinglist by lazy { MutableLiveData<ItemPackingTypeList>() }
|
||||||
|
@ -55,7 +52,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val trainList: LiveData<TrainList>
|
val trainList: LiveData<TrainList>
|
||||||
get() = _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 loadSectorList: LiveData<Event<SectorListVO>> = _sectorList.map { Event(it) }
|
||||||
val loadPrintersList: LiveData<Event<PrintersList>> = _printerList.map { Event(it) }
|
val loadPrintersList: LiveData<Event<PrintersList>> = _printerList.map { Event(it) }
|
||||||
val loadItemPackingList: LiveData<Event<ItemPackingTypeList>> =
|
val loadItemPackingList: LiveData<Event<ItemPackingTypeList>> =
|
||||||
|
@ -175,22 +172,13 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun printerGet(sectorFk: Int) {
|
fun printerGet(sectorFk: Int) {
|
||||||
//Tarea 6276
|
|
||||||
salix.getprinters(
|
salix.getprinters(
|
||||||
"""{"fields":["id","name"],"where":{"sectorFk":$sectorFk,"isLabeler":{"neq":false}}}"""
|
"""{"fields":["id","name"],"where":{"sectorFk":$sectorFk,"isLabeler":{"neq":false}}}"""
|
||||||
).enqueue(object : SalixCallback<List<Printers>>(context) {
|
).enqueue(object : SalixCallback<List<Printers>>(context) {
|
||||||
//silex.printer_get().enqueue(object : SalixCallback<List<Printers>>(context) {
|
|
||||||
override fun onSuccess(response: Response<List<Printers>>) {
|
override fun onSuccess(response: Response<List<Printers>>) {
|
||||||
_printerList.value = response.body()?.let { PrintersList(it) }
|
_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}}""")
|
salix.worker_isF11Allowed("""{"where":{"id":${(context as MobileApplication).userId}},"fields":{"isF11Allowed":true}}""")
|
||||||
.enqueue(object : SalixCallback<JsonObject>(context) {
|
.enqueue(object : SalixCallback<JsonObject>(context) {
|
||||||
override fun onSuccess(response: Response<JsonObject>) {
|
override fun onSuccess(response: Response<JsonObject>) {
|
||||||
_workerAllowedResponse.value = ResponseItemVO(
|
|
||||||
response = response.body()!!.entrySet().first().value.toString(),
|
_workerAllowedResponse.value =
|
||||||
isError = false,
|
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?) {
|
fun workerUpdateOperatorSalix(entity: String, workerFk: Int, sectorFk: Int?, labelerFk: Int?) {
|
||||||
salix.update_operator(id = workerFk, Operator(sectorFk, labelerFk))
|
salix.update_operator(id = workerFk, Operator(sectorFk, labelerFk))
|
||||||
.enqueue(object : SalixCallback<Unit>(context) {
|
.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>) {
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
if (entity == "sector") {
|
if (entity == "sector") {
|
||||||
_actionUpdate.value = ResponseItemVO(
|
_actionUpdate.value = response.message()
|
||||||
response = response.message(),
|
|
||||||
isError = false,
|
|
||||||
errorMessage = ""
|
|
||||||
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onSuccess(response)
|
super.onSuccess(response)
|
||||||
|
|
|
@ -13,9 +13,7 @@ class AjustesItemVO(
|
||||||
class SectorItemVO(
|
class SectorItemVO(
|
||||||
var id: Int,
|
var id: Int,
|
||||||
var description: String,
|
var description: String,
|
||||||
val warehouseFk: Int?,
|
val warehouseFk: Int?
|
||||||
val isError: Boolean = false,
|
|
||||||
var errorMessage: String = ""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class SectorListVO(
|
class SectorListVO(
|
||||||
|
@ -28,10 +26,7 @@ class PrintersList(
|
||||||
|
|
||||||
class Printers(
|
class Printers(
|
||||||
var id: Int,
|
var id: Int,
|
||||||
var name: String,
|
var name: String
|
||||||
val isError: Boolean = false,
|
|
||||||
var errorMessage: String = ""
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class WorkerPrintersList(
|
class WorkerPrintersList(
|
||||||
|
@ -40,9 +35,7 @@ class WorkerPrintersList(
|
||||||
|
|
||||||
class Train(
|
class Train(
|
||||||
var id: Int,
|
var id: Int,
|
||||||
var name: String,
|
var name: String
|
||||||
val isError: Boolean = false,
|
|
||||||
var errorMessage: String = ""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class TrainList(
|
class TrainList(
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
package es.verdnatura.presentation.view.feature.articulo.fragment
|
package es.verdnatura.presentation.view.feature.articulo.fragment
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -55,6 +51,8 @@ class ItemCardFragment(
|
||||||
private var itemsPackingType: ArrayList<ItemPackingType> = ArrayList()
|
private var itemsPackingType: ArrayList<ItemPackingType> = ArrayList()
|
||||||
private var quantityToDiscard = 0
|
private var quantityToDiscard = 0
|
||||||
private var itemInfoG: ItemCardVO? = null
|
private var itemInfoG: ItemCardVO? = null
|
||||||
|
private var firstVisiblePositionX: Int = 0
|
||||||
|
private var firstVisiblePositionY: Int = 0
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
|
fun newInstance(entryPoint: String) = ItemCardFragment(entryPoint)
|
||||||
|
@ -67,7 +65,6 @@ class ItemCardFragment(
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_item_card
|
override fun getLayoutId(): Int = R.layout.fragment_item_card
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
binding.itemcardLayout.visibility = GONE
|
binding.itemcardLayout.visibility = GONE
|
||||||
|
@ -99,11 +96,11 @@ class ItemCardFragment(
|
||||||
val iconSalix = ImageView(context)
|
val iconSalix = ImageView(context)
|
||||||
iconSalix.setImageResource(R.drawable.ic_logo_salix)
|
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)
|
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||||
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
||||||
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
|
iconSalix.tooltipText = getTooltip(R.drawable.ic_logo_salix)
|
||||||
}
|
|
||||||
listIcons.add(iconSalix)
|
listIcons.add(iconSalix)
|
||||||
listIcons.add(iconReload)
|
listIcons.add(iconReload)
|
||||||
listIcons.add(iconHistory)
|
listIcons.add(iconHistory)
|
||||||
|
@ -112,7 +109,6 @@ class ItemCardFragment(
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
|
|
||||||
when (item) {
|
when (item) {
|
||||||
|
@ -134,8 +130,7 @@ class ItemCardFragment(
|
||||||
val itemId = itemInfoG!!.id
|
val itemId = itemInfoG!!.id
|
||||||
val entryPoint = Gson().toJson(
|
val entryPoint = Gson().toJson(
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
"entryPoint" to itemId,
|
"entryPoint" to itemId, "web" to "${
|
||||||
"web" to "${
|
|
||||||
mobileApplication.dataStoreApp.getServerSalix()
|
mobileApplication.dataStoreApp.getServerSalix()
|
||||||
}/#!/item/$itemId/summary"
|
}/#!/item/$itemId/summary"
|
||||||
)
|
)
|
||||||
|
@ -157,23 +152,22 @@ class ItemCardFragment(
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
binding.scrollView.viewTreeObserver.addOnScrollChangedListener {
|
||||||
|
firstVisiblePositionX = binding.scrollView.scrollX
|
||||||
|
firstVisiblePositionY = binding.scrollView.scrollY
|
||||||
|
}
|
||||||
binding.editItemFk.requestFocus()
|
binding.editItemFk.requestFocus()
|
||||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
if (binding.editItemFk.text.toString().isNotEmpty())
|
if (binding.editItemFk.text.toString().isNotEmpty()) try {
|
||||||
try {
|
|
||||||
getItemCard(
|
getItemCard(
|
||||||
itemScanValue(
|
itemScanValue(
|
||||||
binding.editItemFk.text.toString(),
|
binding.editItemFk.text.toString(), "buy", "more"
|
||||||
"buy",
|
|
||||||
"more"
|
|
||||||
).toString()
|
).toString()
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ma.messageWithSound(ex.message.toString(), true, true)
|
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.editItemFk.setText("")
|
binding.editItemFk.setText("")
|
||||||
|
@ -210,83 +204,55 @@ class ItemCardFragment(
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
itemcard.observe(viewLifecycleOwner, Observer {
|
itemCard.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (it.isError) {
|
|
||||||
binding.itemcardLayout.visibility = GONE
|
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (it.id != 0) {
|
if (it.id != 0) {
|
||||||
binding.itemcardLayout.visibility = View.VISIBLE
|
binding.itemcardLayout.visibility = View.VISIBLE
|
||||||
setItemCard(it)
|
setItemCard(it)
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
binding.itemcardLayout.visibility = GONE
|
binding.itemcardLayout.visibility = GONE
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemCard)
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.itemNotFound),
|
getString(R.string.itemNotFound),
|
||||||
true,
|
isError = true,
|
||||||
false,
|
isPlayed = false,
|
||||||
getString(R.string.noResults)
|
getString(R.string.noResults)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
itemspackinglist.observe(viewLifecycleOwner, Observer {
|
|
||||||
|
|
||||||
|
|
||||||
createItemTypeTypeList(it.list)
|
|
||||||
})
|
|
||||||
|
|
||||||
response.observe(viewLifecycleOwner, Observer {
|
|
||||||
|
|
||||||
|
responseItemCard.observe(viewLifecycleOwner) {
|
||||||
getItemCard(itemInfoG!!.id.toString())
|
getItemCard(itemInfoG!!.id.toString())
|
||||||
|
}
|
||||||
})
|
addressLosesList.observe(viewLifecycleOwner) {
|
||||||
addressLosesList.observe(viewLifecycleOwner, Observer {
|
|
||||||
|
|
||||||
if (it.list.isEmpty()) {
|
if (it.list.isEmpty()) {
|
||||||
ma.messageWithSound(getString(R.string.NotAddress), true, false)
|
ma.messageWithSound(
|
||||||
|
getString(R.string.NotAddress), isError = true, isPlayed = false
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
showDialogTrashFault(it.list)
|
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) {
|
private fun setItemCard(itemInfo: ItemCardVO) {
|
||||||
itemInfoG = itemInfo
|
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
|
titleImage = itemInfo.id.toString() + "-" + itemInfo.longName
|
||||||
binding.itemcardImage.loadUrl(itemInfo.urlImage200)
|
binding.itemcardImage.loadUrl(itemInfo.urlImage200)
|
||||||
urlLarge = itemInfo.urlImage
|
urlLarge = itemInfo.urlImage
|
||||||
binding.itemcardTag1.text = itemInfo.size.toString()
|
binding.itemcardTag1.text = itemInfo.size.toString()
|
||||||
binding.itemcardTag2.text = itemInfo.value5
|
binding.itemcardTag2.text = itemInfo.value5
|
||||||
binding.itemcardTag3.text = itemInfo.value6
|
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
|
binding.itemcardBuyer.text = itemInfo.buyer
|
||||||
listItemsRow = ArrayList()
|
listItemsRow = ArrayList()
|
||||||
|
|
||||||
|
@ -313,7 +279,7 @@ class ItemCardFragment(
|
||||||
isEditable = false
|
isEditable = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
var unlocated = ((itemInfo.visible?:0) - (itemInfo.vVisibleItemShelving?:0)).toString()
|
val unlocated = ((itemInfo.visible ?: 0) - (itemInfo.vVisibleItemShelving ?: 0)).toString()
|
||||||
listItemsRow.add(
|
listItemsRow.add(
|
||||||
ItemCardRowVO(
|
ItemCardRowVO(
|
||||||
title = getString(R.string.SINUBICAR),
|
title = getString(R.string.SINUBICAR),
|
||||||
|
@ -407,7 +373,6 @@ class ItemCardFragment(
|
||||||
listBarcodes = itemInfo.barcodes as ArrayList<BarcodeVO>
|
listBarcodes = itemInfo.barcodes as ArrayList<BarcodeVO>
|
||||||
|
|
||||||
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
|
adapter = ItemCardAdapter(listItemsRow, object : OnItemCardRowClickListener {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun onItemCardRowClickListener(item: ItemCardRowVO) {
|
override fun onItemCardRowClickListener(item: ItemCardRowVO) {
|
||||||
|
|
||||||
when (item.action) {
|
when (item.action) {
|
||||||
|
@ -463,12 +428,17 @@ class ItemCardFragment(
|
||||||
binding.scrollView.scrollTo(0, position[1])
|
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) {
|
private fun showCustomDialog(item: ItemCardRowVO, textDescrip: String) {
|
||||||
|
|
||||||
customDialogInput.setTitle(item.title!!)
|
customDialogInput.setTitle(item.title!!).setDescription(textDescrip)
|
||||||
.setDescription(textDescrip)
|
|
||||||
.setOkButton(getString(R.string.save)) {
|
.setOkButton(getString(R.string.save)) {
|
||||||
customDialogAdd(item)
|
customDialogAdd(item)
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -478,8 +448,7 @@ class ItemCardFragment(
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.setValue("").show()
|
}.setValue("").show()
|
||||||
customDialogInput.getEditText().requestFocus()
|
customDialogInput.getEditText().requestFocus()
|
||||||
customDialogInput.getEditText()
|
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||||
.setOnEditorActionListener { _, actionId, _ ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
customDialogAdd(item)
|
customDialogAdd(item)
|
||||||
return@setOnEditorActionListener true
|
return@setOnEditorActionListener true
|
||||||
|
@ -491,19 +460,16 @@ class ItemCardFragment(
|
||||||
private fun customDialogAdd(item: ItemCardRowVO) {
|
private fun customDialogAdd(item: ItemCardRowVO) {
|
||||||
try {
|
try {
|
||||||
editItemCardRow(
|
editItemCardRow(
|
||||||
item,
|
item, customDialogInput.getValue().toInt()
|
||||||
customDialogInput.getValue().toInt()
|
|
||||||
)
|
)
|
||||||
customDialogInput.setValue("")
|
customDialogInput.setValue("")
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
ma.hideKeyboard(customDialogInput.getEditText())
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
|
||||||
if (item.action == "itemSaveStem"
|
if (item.action == "itemSaveStem") {
|
||||||
) {
|
viewModel.updateStems(
|
||||||
viewModel.item_saveStems(
|
itemFk = itemInfoG!!.id, value = null
|
||||||
itemFk = itemInfoG!!.id,
|
|
||||||
value = null
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
getString(R.string.errorInput).toast(requireContext())
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
|
@ -514,13 +480,15 @@ class ItemCardFragment(
|
||||||
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
|
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
|
||||||
when (item.action) {
|
when (item.action) {
|
||||||
"itemStockUpdateAdd" -> {
|
"itemStockUpdateAdd" -> {
|
||||||
showProgress()
|
|
||||||
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, value * -1, null)
|
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, value * -1, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
|
"itemStockUpdateRemove" -> {
|
||||||
"updateGrouping" ->
|
viewModel.getAddress()
|
||||||
viewModel.updateGrouping(
|
quantityToDiscard = value
|
||||||
|
}
|
||||||
|
|
||||||
|
"updateGrouping" -> viewModel.updateGrouping(
|
||||||
warehouseFk = warehouseFk!!,
|
warehouseFk = warehouseFk!!,
|
||||||
itemFk = itemInfoG!!.id,
|
itemFk = itemInfoG!!.id,
|
||||||
value = value,
|
value = value,
|
||||||
|
@ -534,43 +502,18 @@ class ItemCardFragment(
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
"itemSaveStem" -> viewModel.item_saveStems(
|
"itemSaveStem" -> viewModel.updateStems(
|
||||||
itemFk = itemInfoG!!.id,
|
itemFk = itemInfoG!!.id, value = value
|
||||||
value = value
|
|
||||||
)
|
)
|
||||||
|
|
||||||
"item_saveReference" -> viewModel.item_saveReference(
|
"item_saveReference" -> viewModel.updateReference(
|
||||||
itemFk = itemInfoG!!.id,
|
itemFk = itemInfoG!!.id, value = value
|
||||||
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>) {
|
private fun showDialogTrashFault(listAddress: List<AddressLoses>) {
|
||||||
|
|
||||||
|
@ -614,8 +557,10 @@ class ItemCardFragment(
|
||||||
private fun setUpdateBarcode() {
|
private fun setUpdateBarcode() {
|
||||||
try {
|
try {
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
if (customDialogList.getValue().isNotEmpty())
|
if (customDialogList.getValue().isNotEmpty()) updateBarcode(
|
||||||
updateBarcode(customDialogList.getValue(), false)
|
customDialogList.getValue(),
|
||||||
|
false
|
||||||
|
)
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
|
||||||
|
@ -626,60 +571,16 @@ class ItemCardFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateBarcode(code: String, delete: Boolean) {
|
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(
|
viewModel.barcodesEditSalix(
|
||||||
itemFk = itemInfoG!!.id,
|
itemFk = itemInfoG!!.id,
|
||||||
barCodeValue = code,
|
barCodeValue = code,
|
||||||
delete = delete,
|
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) {
|
override fun onClickDynamic(addressFK: Int) {
|
||||||
|
|
||||||
|
|
||||||
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, quantityToDiscard, addressFK)
|
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, quantityToDiscard, addressFK)
|
||||||
customDynamic.dismiss()
|
customDynamic.dismiss()
|
||||||
customDynamic.cancel()
|
customDynamic.cancel()
|
||||||
|
|
|
@ -6,15 +6,12 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
||||||
import es.verdnatura.presentation.common.ItemDiscardSalixShortage
|
import es.verdnatura.presentation.common.ItemDiscardSalixShortage
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
|
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.AddressLosesList
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
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.ItemProposal
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposalList
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposalList
|
||||||
import okhttp3.MediaType
|
import okhttp3.MediaType
|
||||||
|
@ -25,25 +22,21 @@ import java.io.File
|
||||||
|
|
||||||
class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _itemcard by lazy { MutableLiveData<ItemCardVO>() }
|
private val _itemCard by lazy { MutableLiveData<ItemCardVO>() }
|
||||||
val itemcard: LiveData<ItemCardVO>
|
val itemCard: LiveData<ItemCardVO>
|
||||||
get() = _itemcard
|
get() = _itemCard
|
||||||
|
|
||||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseItemCard by lazy { MutableLiveData<Any>() }
|
||||||
val response: LiveData<ResponseItemVO>
|
val responseItemCard: LiveData<Any>
|
||||||
get() = _response
|
get() = _responseItemCard
|
||||||
|
|
||||||
private val _responseCode by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseCode by lazy { MutableLiveData<String>() }
|
||||||
val responseCode: LiveData<ResponseItemVO>
|
val responseCode: LiveData<String>
|
||||||
get() = _responseCode
|
get() = _responseCode
|
||||||
|
|
||||||
private val _itemspackinglist by lazy { MutableLiveData<ItemPackingTypeList>() }
|
private val _itemProposalList by lazy { MutableLiveData<ItemProposalList>() }
|
||||||
val itemspackinglist: LiveData<ItemPackingTypeList>
|
val itemProposalList: LiveData<ItemProposalList>
|
||||||
get() = _itemspackinglist
|
get() = _itemProposalList
|
||||||
|
|
||||||
private val _itemProposallist by lazy { MutableLiveData<ItemProposalList>() }
|
|
||||||
val itemProposallist: LiveData<ItemProposalList>
|
|
||||||
get() = _itemProposallist
|
|
||||||
|
|
||||||
private val _addressLosesList by lazy { MutableLiveData<AddressLosesList>() }
|
private val _addressLosesList by lazy { MutableLiveData<AddressLosesList>() }
|
||||||
val addressLosesList: LiveData<AddressLosesList>
|
val addressLosesList: LiveData<AddressLosesList>
|
||||||
|
@ -56,31 +49,9 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
//Tarea 6276
|
//Tarea 6276
|
||||||
salix.getCard(barcode = itemFk, warehouseFk = warehouseFk)
|
salix.getCard(barcode = itemFk, warehouseFk = warehouseFk)
|
||||||
.enqueue(object : SalixCallback<ItemCardVO>(context) {
|
.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>) {
|
override fun onSuccess(response: Response<ItemCardVO>) {
|
||||||
if (response.body() != null) {
|
_itemCard.value = response.body() ?: ItemCardVO()
|
||||||
|
|
||||||
_itemcard.value = response.body()!!
|
|
||||||
} else {
|
|
||||||
_itemcard.value = ItemCardVO(
|
|
||||||
0,
|
|
||||||
isError = true,
|
|
||||||
errorMessage = getMessageFromAllResponse(
|
|
||||||
nameofFunction(this),
|
|
||||||
response.message()
|
|
||||||
),
|
|
||||||
stems = "",
|
|
||||||
itemCost = ""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -96,35 +67,13 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
params = arrayListOf(itemFk, warehouseFk, shipped, isShowedByType).formatWithQuotes()
|
params = arrayListOf(itemFk, warehouseFk, shipped, isShowedByType).formatWithQuotes()
|
||||||
).enqueue(object : SalixCallback<List<ItemProposal>>(context) {
|
).enqueue(object : SalixCallback<List<ItemProposal>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemProposal>>) {
|
override fun onSuccess(response: Response<List<ItemProposal>>) {
|
||||||
_itemProposallist.value = response.body()?.let {
|
_itemProposalList.value = response.body()?.let {
|
||||||
ItemProposalList(it)
|
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(
|
fun setVisibleDiscard(
|
||||||
itemFk: Int,
|
itemFk: Int,
|
||||||
warehouseFk: Int,
|
warehouseFk: Int,
|
||||||
|
@ -135,111 +84,74 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
salix.setVisibleDiscard(
|
salix.setVisibleDiscard(
|
||||||
ItemDiscardSalixShortage(itemFk, warehouseFk, quantity, addressFk)
|
ItemDiscardSalixShortage(itemFk, warehouseFk, quantity, addressFk)
|
||||||
)
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
|
||||||
override fun onError(t: Throwable) {
|
|
||||||
_response.value = ResponseItemVO(
|
|
||||||
isError = true,
|
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value =
|
_responseItemCard.value = response.message()
|
||||||
ResponseItemVO(isError = false, response = response.message())
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateGrouping(
|
fun updateGrouping(
|
||||||
itemFk: Int,
|
itemFk: Int, value: Int?, warehouseFk: Int
|
||||||
value: Int?,
|
|
||||||
warehouseFk: Int
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
salix.updateGrouping(params = arrayListOf(warehouseFk, itemFk, value))
|
salix.updateGrouping(params = arrayListOf(warehouseFk, itemFk, value))
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value =
|
_responseItemCard.value = response.message()
|
||||||
ResponseItemVO(isError = false, response = response.message())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updatePacking(
|
fun updatePacking(
|
||||||
itemFk: Int,
|
itemFk: Int, value: Int, warehouseFk: Int
|
||||||
value: Int,
|
|
||||||
warehouseFk: Int
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
salix.updatePacking(params = arrayListOf(warehouseFk, itemFk, value))
|
salix.updatePacking(params = arrayListOf(warehouseFk, itemFk, value))
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value =
|
_responseItemCard.value = response.message()
|
||||||
ResponseItemVO(isError = false, response = response.message())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updatePackingTypeSalix(itemFk: Int, itemPackingTypeFk: String) {
|
fun updateStems(
|
||||||
salix.updateItem(itemFk, hashMapOf("itemPackingTypeFk" to itemPackingTypeFk))
|
itemFk: Int, value: Int?
|
||||||
.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?
|
|
||||||
) {
|
) {
|
||||||
salix.updateItem(itemFk, hashMapOf("stems" to value))
|
salix.updateItem(itemFk, hashMapOf("stems" to value))
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value =
|
_responseItemCard.value = response.message()
|
||||||
ResponseItemVO(isError = false, response = response.message())
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun item_saveReference(
|
fun updateReference(
|
||||||
itemFk: Int,
|
itemFk: Int, value: Int
|
||||||
value: Int
|
|
||||||
) {
|
) {
|
||||||
salix.updateItem(itemFk, hashMapOf("comment" to value))
|
salix.updateItem(itemFk, hashMapOf("comment" to value))
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value = ResponseItemVO(isError = false)
|
_responseItemCard.value = response.message()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getIdFromCodeSalix(code: String) {
|
fun getIdFromCodeSalix(code: String) {
|
||||||
salix.barcodes_toitem(code)
|
salix.barcodes_toitem(code).enqueue(object : SalixCallback<String?>(context) {
|
||||||
.enqueue(object : SalixCallback<String?>(context) {
|
|
||||||
|
|
||||||
override fun onSuccess(response: Response<String?>) {
|
override fun onSuccess(response: Response<String?>) {
|
||||||
_responseCode.value =
|
_responseCode.value = response.body() ?: ""
|
||||||
ResponseItemVO(
|
|
||||||
isError = false,
|
|
||||||
response = if (response.body() == null) "" else {
|
|
||||||
response!!.body().toString()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun barcodesEditSalix(itemFk: Int, barCodeValue: String, delete: Boolean) {
|
fun barcodesEditSalix(itemFk: Int, barCodeValue: String, delete: Boolean) {
|
||||||
|
|
||||||
if (delete) {
|
if (delete) {
|
||||||
|
@ -249,11 +161,10 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
ItemBarCodeSalix(itemFk, barCodeValue)
|
ItemBarCodeSalix(itemFk, barCodeValue)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}.enqueue(object : SalixCallback<Any>(context) {
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value =
|
_responseItemCard.value =
|
||||||
ResponseItemVO(isError = false, response = response.message()!!)
|
ResponseItemVO(isError = false, response = response.message()!!)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -269,9 +180,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
file: File = File(urlImage),
|
file: File = File(urlImage),
|
||||||
fileRequestBody: RequestBody = RequestBody.create(MediaType.parse("image/jpeg"), file),
|
fileRequestBody: RequestBody = RequestBody.create(MediaType.parse("image/jpeg"), file),
|
||||||
filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
||||||
"file",
|
"file", file.name, fileRequestBody
|
||||||
file.name,
|
|
||||||
fileRequestBody
|
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
salix.uploadImage("catalog", itemFK, filePart)
|
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)
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentItemproposalBinding
|
import es.verdnatura.databinding.FragmentItemproposalBinding
|
||||||
|
@ -29,7 +29,6 @@ class ItemProposalFragment(
|
||||||
private var adapter: ItemProposalAdapter? = null
|
private var adapter: ItemProposalAdapter? = null
|
||||||
private var listProposal: ArrayList<ItemProposal> = ArrayList()
|
private var listProposal: ArrayList<ItemProposal> = ArrayList()
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var hideLoad = true
|
|
||||||
private var layoutManager: LinearLayoutManager? = null
|
private var layoutManager: LinearLayoutManager? = null
|
||||||
private var filter = true
|
private var filter = true
|
||||||
|
|
||||||
|
@ -73,10 +72,8 @@ class ItemProposalFragment(
|
||||||
val iconFilter = ImageView(context)
|
val iconFilter = ImageView(context)
|
||||||
iconFilter.setImageResource(R.drawable.filter_outline)
|
iconFilter.setImageResource(R.drawable.filter_outline)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
iconFilter.tooltipText = getTooltip(R.drawable.filter_outline)
|
iconFilter.tooltipText = getTooltip(R.drawable.filter_outline)
|
||||||
}
|
ResourcesCompat.getDrawable(resources, R.drawable.filter_outline, resources.newTheme())
|
||||||
resources.getDrawable(R.drawable.filter_outline, resources.newTheme())
|
|
||||||
|
|
||||||
listIcons.add(iconFilter)
|
listIcons.add(iconFilter)
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
|
@ -117,13 +114,9 @@ class ItemProposalFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
itemProposallist.observe(viewLifecycleOwner) { it ->
|
itemProposalList.observe(viewLifecycleOwner) { it ->
|
||||||
if (hideLoad) {
|
|
||||||
} else {
|
|
||||||
hideLoad = true
|
|
||||||
}
|
|
||||||
listProposal = ArrayList()
|
listProposal = ArrayList()
|
||||||
if (!it.list.isNullOrEmpty()) {
|
if (it.list.isNotEmpty()) {
|
||||||
it.list.forEach {
|
it.list.forEach {
|
||||||
|
|
||||||
listProposal.add(it)
|
listProposal.add(it)
|
||||||
|
|
|
@ -8,18 +8,15 @@ class ItemCardVO(
|
||||||
var value7: String? = null,
|
var value7: String? = null,
|
||||||
var image: String? = null,
|
var image: String? = null,
|
||||||
var size: Int? = null,
|
var size: Int? = null,
|
||||||
var stems: String?,
|
var stems: String? = null,
|
||||||
var itemCost: String?,
|
var itemCost: String? = null,
|
||||||
var category:String? = null,
|
var category:String? = null,
|
||||||
var producer: String? = null,
|
var producer: String? = null,
|
||||||
var origin: String? = null,
|
var origin: String? = null,
|
||||||
//var nicho: Int? = null,
|
|
||||||
var reserva: Int? = null,
|
var reserva: Int? = null,
|
||||||
var enNicho: Int? = null,
|
var enNicho: Int? = null,
|
||||||
var available: Int? = null,
|
var available: Int? = null,
|
||||||
//var enAltillo: Int? = null,
|
|
||||||
var repo: Int? = null,
|
var repo: Int? = null,
|
||||||
//var total: Int? = null,
|
|
||||||
var min: Int? = null,
|
var min: Int? = null,
|
||||||
var grouping: Int? = null,
|
var grouping: Int? = null,
|
||||||
var packing: Int? = null,
|
var packing: Int? = null,
|
||||||
|
@ -27,17 +24,14 @@ class ItemCardVO(
|
||||||
var tag5: String? = null,
|
var tag5: String? = null,
|
||||||
var tag6: String? = null,
|
var tag6: String? = null,
|
||||||
var tag7: String? = null,
|
var tag7: String? = null,
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = "",
|
|
||||||
var urlImage200: String? = null,
|
var urlImage200: String? = null,
|
||||||
var urlImage: String? = null,
|
var urlImage: String? = null,
|
||||||
var itemPackingTypeFk: String? = null,
|
var itemPackingTypeFk: String? = null,
|
||||||
var reference: String? = null,
|
var reference: String? = null,
|
||||||
var buyer: String? = null,
|
var buyer: String? = null,
|
||||||
//sergio para modificar la llamada de itemCard a item_getInfo
|
var vVisibleItemShelving: Int? = null,
|
||||||
var vVisibleItemShelving: Int? = null, // = enAltillo
|
var visible: Int? = null,
|
||||||
var visible: Int? = null,// = total
|
var unlocated: Int? = null
|
||||||
var unlocated: Int? = null //= enNicho
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,7 @@ class ItemPackingType (
|
||||||
|
|
||||||
var code:String= "",
|
var code:String= "",
|
||||||
var description:String = "",
|
var description:String = "",
|
||||||
var isActive:Boolean = false,
|
var isActive:Boolean = false
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage:String = ""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class ItemPackingTypeList (
|
class ItemPackingTypeList (
|
||||||
|
|
|
@ -21,9 +21,6 @@ class ItemProposal(
|
||||||
var counter: Int? = null,
|
var counter: Int? = null,
|
||||||
var minQuantity: Int? = null,
|
var minQuantity: Int? = null,
|
||||||
|
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = ""
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class ItemProposalList(
|
class ItemProposalList(
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.buffer.fragment
|
package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||||
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentBufferBinding
|
import es.verdnatura.databinding.FragmentBufferBinding
|
||||||
import es.verdnatura.domain.toInt
|
import es.verdnatura.domain.toInt
|
||||||
|
@ -72,10 +71,14 @@ class BufferFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
itembuffertype.observe(viewLifecycleOwner, Observer {
|
itemBufferType.observe(viewLifecycleOwner) {
|
||||||
|
if (itemBufferType.value == false) {
|
||||||
|
ma.messageWithSound(getString(R.string.errorInput), isError = true, isPlayed = true, isToasted = true)
|
||||||
|
} else {
|
||||||
binding.mainToolbar.backButton.performClick()
|
binding.mainToolbar.backButton.performClick()
|
||||||
|
}
|
||||||
|
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,52 +4,44 @@ import android.content.Context
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class BufferFragmentViewModel(val context: Context) : BaseViewModel(context) {
|
class BufferFragmentViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _itembuffertype by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _itemBufferType by lazy { MutableLiveData<Boolean>() }
|
||||||
val itembuffertype: LiveData<ResponseItemVO>
|
val itemBufferType: LiveData<Boolean>
|
||||||
get() = _itembuffertype
|
get() = _itemBufferType
|
||||||
|
|
||||||
private val _bufferloadresponse by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _bufferLoadResponse by lazy { MutableLiveData<String>() }
|
||||||
val bufferloadresponse: LiveData<ResponseItemVO>
|
val bufferLoadResponse: LiveData<String>
|
||||||
get() = _bufferloadresponse
|
get() = _bufferLoadResponse
|
||||||
|
|
||||||
fun bufferSetTypeByName(vBufferFk: Int, vType: String) {
|
fun bufferSetTypeByName(vBufferFk: Int, vType: String) {
|
||||||
salix.buffer_setTypeByName(params = listOf(vBufferFk, vType).formatWithQuotes())
|
salix.buffer_setTypeByName(params = listOf(vBufferFk, vType).formatWithQuotes())
|
||||||
.enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
.enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||||
override fun onSuccess(response: Response<List<JsonObject>>) {
|
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 {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
|
|
||||||
)
|
_itemBufferType.value =
|
||||||
|
response.body()?.get(0)?.entrySet()?.first()?.value.toString() == "1"
|
||||||
|
if (_itemBufferType.value == true) {
|
||||||
super.onSuccess(response)
|
super.onSuccess(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun expeditionLoadingAdd(vExpeditionFk: Int, vBufferFk: Int) {
|
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) {
|
.enqueue(object : SalixCallback<List<Map<String, Any>>>(context) {
|
||||||
override fun onSuccess(response: Response<List<Map<String, Any>>>) {
|
override fun onSuccess(response: Response<List<Map<String, Any>>>) {
|
||||||
_bufferloadresponse.value =
|
_bufferLoadResponse.value = response.body()!![0]["vMessage"].toString()
|
||||||
ResponseItemVO(
|
|
||||||
isError = false,
|
|
||||||
response = response.body()!![0]["vMessage"].toString()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.buffer.fragment
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
import es.verdnatura.databinding.FragmentBufferLoadexpeditionBinding
|
||||||
|
@ -11,8 +10,8 @@ import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnSmartTagRowClickListener
|
import es.verdnatura.presentation.common.OnSmartTagRowClickListener
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
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.main.activity.MainActivity
|
||||||
import es.verdnatura.presentation.view.feature.smarttag.adapter.BufferAdapter
|
|
||||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||||
|
|
||||||
class BufferLoadFragment(
|
class BufferLoadFragment(
|
||||||
|
@ -65,7 +64,7 @@ class BufferLoadFragment(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
customDialogList.setTitle(getString(R.string.scanBuffer))
|
customDialogList.setTitle(getString(R.string.scanBuffer))
|
||||||
tagsAdapter!!.notifyDataSetChanged()
|
tagsAdapter!!.notifyItemInserted(listTags.size - 1)
|
||||||
|
|
||||||
if (listTags.size == 2) {
|
if (listTags.size == 2) {
|
||||||
viewModel.expeditionLoadingAdd(
|
viewModel.expeditionLoadingAdd(
|
||||||
|
@ -89,20 +88,23 @@ class BufferLoadFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
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()
|
listTags.clear()
|
||||||
tagsAdapter!!.notifyDataSetChanged()
|
tagsAdapter!!.notifyItemRangeRemoved(
|
||||||
|
0, 2
|
||||||
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
showExpeditionOrBufferScan()
|
showExpeditionOrBufferScan()
|
||||||
|
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,8 +140,8 @@ class BufferLoadFragment(
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
customDialogList.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) {
|
||||||
if (!customDialogList.getValue().isNullOrEmpty()) {
|
if (customDialogList.getValue().isNotEmpty()) {
|
||||||
try {
|
try {
|
||||||
checkLoadExpedition(customDialogList.getValue().toInt())
|
checkLoadExpedition(customDialogList.getValue().toInt())
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
|
|
@ -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
|
import android.view.LayoutInflater
|
||||||
|
@ -12,7 +12,7 @@ import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||||
|
|
||||||
class BufferAdapter(
|
class BufferAdapter(
|
||||||
private val items: List<SmartTag>,
|
private val items: List<SmartTag>,
|
||||||
private val OnSmartTagRowClickListener: OnSmartTagRowClickListener,
|
private val onSmartTagRowClickListener: OnSmartTagRowClickListener,
|
||||||
private var showDelete: Boolean = true
|
private var showDelete: Boolean = true
|
||||||
): RecyclerView.Adapter<BufferAdapter.ItemHolder> () {
|
): RecyclerView.Adapter<BufferAdapter.ItemHolder> () {
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class BufferAdapter(
|
||||||
holder.bind(items[position])
|
holder.bind(items[position])
|
||||||
|
|
||||||
holder.binding.root.setOnClickListener {
|
holder.binding.root.setOnClickListener {
|
||||||
OnSmartTagRowClickListener.OnSmartTagRowClickListener(items[position])
|
onSmartTagRowClickListener.OnSmartTagRowClickListener(items[position])
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,10 +1,7 @@
|
||||||
package es.verdnatura.presentation.view.feature.buscaritem.fragment
|
package es.verdnatura.presentation.view.feature.buscaritem.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentBuscarItemBinding
|
import es.verdnatura.databinding.FragmentBuscarItemBinding
|
||||||
|
@ -32,7 +29,6 @@ class BuscarItemFragment(
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_buscar_item
|
override fun getLayoutId(): Int = R.layout.fragment_buscar_item
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.getubicaition)
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -42,7 +38,6 @@ class BuscarItemFragment(
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.editItemFk.requestFocus()
|
binding.editItemFk.requestFocus()
|
||||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||||
|
@ -54,7 +49,7 @@ class BuscarItemFragment(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ma.messageWithSound(ex.message.toString(), true, true)
|
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed = true)
|
||||||
}
|
}
|
||||||
binding.editItemFk.setText("")
|
binding.editItemFk.setText("")
|
||||||
ma.hideKeyboard(binding.editItemFk)
|
ma.hideKeyboard(binding.editItemFk)
|
||||||
|
@ -76,12 +71,12 @@ class BuscarItemFragment(
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadLocationList.observe(viewLifecycleOwner, Observer { event ->
|
loadLocationList.observe(viewLifecycleOwner) { event ->
|
||||||
|
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull { itemResponse ->
|
||||||
|
|
||||||
try {
|
try {
|
||||||
adapter = LocationAdapter(it.list, pasillerosItemClickListener!!)
|
adapter = LocationAdapter(itemResponse.list, pasillerosItemClickListener!!)
|
||||||
binding.locationRecyclerview.adapter = adapter
|
binding.locationRecyclerview.adapter = adapter
|
||||||
binding.locationRecyclerview.layoutManager =
|
binding.locationRecyclerview.layoutManager =
|
||||||
LinearLayoutManager(
|
LinearLayoutManager(
|
||||||
|
@ -96,10 +91,16 @@ class BuscarItemFragment(
|
||||||
isPlayed = true
|
isPlayed = true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text = (
|
||||||
getString(R.string.item) + itemFk + " " + getString(R.string.visibleTotal) + it.list.sumOf { it.visible }
|
getString(
|
||||||
|
R.string.itemsTotal,
|
||||||
|
itemFk,
|
||||||
|
getString(R.string.visibleTotal),
|
||||||
|
itemResponse.list.sumOf { it.visible })
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@ class BuscarItemViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val loadLocationList: LiveData<Event<LocationListVO>> = _locationList.map { Event(it) }
|
val loadLocationList: LiveData<Event<LocationListVO>> = _locationList.map { Event(it) }
|
||||||
|
|
||||||
fun itemshelvingGetInfo(itemFk: Any) {
|
fun itemshelvingGetInfo(itemFk: Any) {
|
||||||
//salix falla fecha
|
|
||||||
// silex.searchItemsUbicador(itemFk)
|
|
||||||
salix.itemshelvingGetInfo(params = arrayListOf(itemFk).formatWithQuotes())
|
salix.itemshelvingGetInfo(params = arrayListOf(itemFk).formatWithQuotes())
|
||||||
.enqueue(object : SalixCallback<List<ItemLocationVO>>(context) {
|
.enqueue(object : SalixCallback<List<ItemLocationVO>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
|
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
|
||||||
|
|
|
@ -1,22 +1,16 @@
|
||||||
package es.verdnatura.presentation.view.feature.buscaritem.model
|
package es.verdnatura.presentation.view.feature.buscaritem.model
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import es.verdnatura.domain.isoToString
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemLocationVO @RequiresApi(Build.VERSION_CODES.O) constructor(
|
class ItemLocationVO(
|
||||||
var Parking: String = "",
|
var Parking: String = "",
|
||||||
var Matricula: String = "",
|
var Matricula: String = "",
|
||||||
var visible: Int = 0,
|
var visible: Int = 0,
|
||||||
var itemFk: Int = 0,
|
var itemFk: Int = 0,
|
||||||
val isError: Boolean = false,
|
|
||||||
var errorMessage: String = "",
|
|
||||||
var priority: Int = 0
|
var priority: Int = 0
|
||||||
|
|
||||||
) {
|
) {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
var created: String = ""
|
var created: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get() {
|
get() {
|
||||||
return field.isoToString()
|
return field.isoToString()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
package es.verdnatura.presentation.view.feature.calidad.model
|
package es.verdnatura.presentation.view.feature.calidad.model
|
||||||
|
|
||||||
//import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
|
||||||
|
|
||||||
class BuyerVO(
|
class BuyerVO(
|
||||||
var userFk: Int,
|
var userFk: Int,
|
||||||
var nickname: String,
|
var nickname: String,
|
||||||
var isError:Boolean = false,
|
|
||||||
var errorMessage:String = ""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class BuyerListVO(
|
class BuyerListVO(
|
||||||
var list: List<BuyerVO> = listOf()
|
var list: List<BuyerVO> = listOf()
|
||||||
)
|
)
|
||||||
|
@ -24,8 +19,6 @@ class ItemBuyerVO (
|
||||||
var visible: String = "",
|
var visible: String = "",
|
||||||
var created: String = "",
|
var created: String = "",
|
||||||
var stars: String = "",
|
var stars: String = "",
|
||||||
var isError:Boolean = false,
|
|
||||||
var errorMessage:String = "",
|
|
||||||
var showStars: Boolean = false,
|
var showStars: Boolean = false,
|
||||||
var iconResourceOk: Int = 0,
|
var iconResourceOk: Int = 0,
|
||||||
var iconResourceKo: Int = 0
|
var iconResourceKo: Int = 0
|
||||||
|
|
|
@ -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.content.Context
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -10,7 +10,7 @@ import es.verdnatura.databinding.ItemArticleRowReubicationFragmentBinding
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnReubicationClickListener
|
import es.verdnatura.presentation.common.OnReubicationClickListener
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
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(
|
class ReubicatorAdapter(
|
|
@ -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.content.Context
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -8,7 +8,7 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ItemPlacementReubicationRowBinding
|
import es.verdnatura.databinding.ItemPlacementReubicationRowBinding
|
||||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
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(
|
class ReubicatorPlacementAdapter(
|
||||||
private val items: List<PlacementReubication>,
|
private val items: List<PlacementReubication>,
|
|
@ -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.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -14,8 +13,8 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
import es.verdnatura.presentation.common.OnReubicationClickListener
|
import es.verdnatura.presentation.common.OnReubicationClickListener
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
import es.verdnatura.presentation.view.component.CustomDialogInputTwoValues
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
import es.verdnatura.presentation.view.component.CustomDialogThreeButtons
|
||||||
import es.verdnatura.presentation.view.feature.reubication.adapter.ReubicatorAdapter
|
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.adapter.ReubicatorAdapter
|
||||||
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.ubicador.fragment.UbicadorViewModel
|
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
|
@ -63,7 +62,7 @@ class ReubicationCollectionFragment(
|
||||||
|
|
||||||
for (item in list) {
|
for (item in list) {
|
||||||
item.code = shelving.uppercase()
|
item.code = shelving.uppercase()
|
||||||
if (!item.carros.isNullOrEmpty()) {
|
if (item.carros.isNotEmpty()) {
|
||||||
for (i in item.carros) {
|
for (i in item.carros) {
|
||||||
i.visible = "(" + i.visible + ")"
|
i.visible = "(" + i.visible + ")"
|
||||||
}
|
}
|
||||||
|
@ -90,7 +89,9 @@ class ReubicationCollectionFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.collectionSwipe.setOnRefreshListener {
|
binding.collectionSwipe.setOnRefreshListener {
|
||||||
callItemShelvingReturn()
|
viewModel.itemShelvingAlternative(
|
||||||
|
shelvingFk = shelving,
|
||||||
|
)
|
||||||
binding.collectionSwipe.isRefreshing = false
|
binding.collectionSwipe.isRefreshing = false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -104,7 +105,9 @@ class ReubicationCollectionFragment(
|
||||||
scanPlate(binding.scanInput.text.toString().uppercase())
|
scanPlate(binding.scanInput.text.toString().uppercase())
|
||||||
} else {
|
} else {
|
||||||
shelving = binding.scanInput.text.toString().uppercase()
|
shelving = binding.scanInput.text.toString().uppercase()
|
||||||
callItemShelvingReturn()
|
viewModel.itemShelvingAlternative(
|
||||||
|
shelvingFk = shelving,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +134,10 @@ class ReubicationCollectionFragment(
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
ma.messageWithSound(
|
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.setInfoTextTwo(getString(R.string.shelving))
|
||||||
|
|
||||||
customDialogInputTwoValues.setDescription(messageDescrip)
|
customDialogInputTwoValues.setDescription(messageDescrip)
|
||||||
.setValue(itemReubication.quantity.toString())
|
.setValue(itemReubication.quantity)
|
||||||
.setOkButton(getString(R.string.leaveItem)) {
|
.setOkButton(getString(R.string.leaveItem)) {
|
||||||
|
|
||||||
customDialogMerge(itemReubication)
|
customDialogMerge(itemReubication)
|
||||||
|
@ -175,12 +181,12 @@ class ReubicationCollectionFragment(
|
||||||
private fun customDialogMerge(itemReubication: Reubication) {
|
private fun customDialogMerge(itemReubication: Reubication) {
|
||||||
|
|
||||||
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
if (customDialogInputTwoValues.getValueTwo().isNotEmpty()) {
|
||||||
viewModel.itemShelving_merge(
|
viewModel.itemShelvingMerge(
|
||||||
itemReubication.id, customDialogInputTwoValues.getValueTwo().uppercase()
|
itemReubication.id, customDialogInputTwoValues.getValueTwo().uppercase()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.returnScan), true, true, isToasted = true
|
getString(R.string.returnScan), isError = true, isPlayed = true, isToasted = true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
customDialogInputTwoValues.setValue("")
|
customDialogInputTwoValues.setValue("")
|
||||||
|
@ -204,38 +210,28 @@ class ReubicationCollectionFragment(
|
||||||
if (it.list.isEmpty()) {
|
if (it.list.isEmpty()) {
|
||||||
|
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.successReubication), false, true, getString(
|
getString(R.string.successReubication),
|
||||||
|
isError = false,
|
||||||
|
isPlayed = true,
|
||||||
|
getString(
|
||||||
R.string.info
|
R.string.info
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ma.onMyBackPressed()
|
ma.onMyBackPressed()
|
||||||
} else {
|
|
||||||
if (it.list[0].isError) {
|
|
||||||
ma.messageWithSound(
|
|
||||||
it.list[0].errorMessage, true, true, getString(
|
|
||||||
R.string.info
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
showList(it.list)
|
showList(it.list)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response.observe(viewLifecycleOwner) {
|
response.observe(viewLifecycleOwner) {
|
||||||
callItemShelvingReturn()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun callItemShelvingReturn() {
|
|
||||||
viewModel.itemShelvingAlternative(
|
viewModel.itemShelvingAlternative(
|
||||||
shelvingFk = shelving,
|
shelvingFk = shelving,
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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.content.Context
|
||||||
import android.view.View.GONE
|
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -9,7 +8,6 @@ import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||||
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
||||||
|
|
||||||
class ReubicationFragment(var entrypoint: String) :
|
class ReubicationFragment(var entrypoint: String) :
|
||||||
|
@ -45,7 +43,6 @@ class ReubicationFragment(var entrypoint: String) :
|
||||||
super.onPause()
|
super.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
|
@ -80,39 +77,24 @@ class ReubicationFragment(var entrypoint: String) :
|
||||||
|
|
||||||
if (it.list.isEmpty()) {
|
if (it.list.isEmpty()) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.errorReubication), true, true, getString(
|
getString(R.string.errorReubication),
|
||||||
R.string.info
|
isError = true,
|
||||||
)
|
isPlayed = true,
|
||||||
)
|
getString(
|
||||||
} else {
|
|
||||||
if (it.list[0].isError) {
|
|
||||||
ma.messageWithSound(
|
|
||||||
it.list[0].errorMessage, true, true, getString(
|
|
||||||
R.string.info
|
R.string.info
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
ma.openFragmentReubications(it.list, shelvingScaned)
|
||||||
|
|
||||||
createReubications(it.list)
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createReubications(list: List<Reubication>) {
|
|
||||||
|
|
||||||
ma.openFragmentReubications(list as MutableList<Reubication>, shelvingScaned)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
import com.google.gson.annotations.SerializedName
|
||||||
|
|
||||||
|
@ -16,8 +16,6 @@ class Reubication(
|
||||||
@SerializedName(value = "carros", alternate = ["shelvings"])
|
@SerializedName(value = "carros", alternate = ["shelvings"])
|
||||||
var carros: MutableList<PlacementReubication> = mutableListOf(),//placements
|
var carros: MutableList<PlacementReubication> = mutableListOf(),//placements
|
||||||
var pickingOrder:Int=0,//no
|
var pickingOrder:Int=0,//no
|
||||||
var isError: Boolean=false,
|
|
||||||
var errorMessage: String=""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class PlacementReubication(
|
class PlacementReubication(
|
|
@ -1,13 +1,13 @@
|
||||||
@file:Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@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.View.GONE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.GeneralAdapter
|
import es.verdnatura.presentation.common.GeneralAdapter
|
||||||
import es.verdnatura.presentation.common.GeneralItem
|
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.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||||
|
|
||||||
class ClaimFragment(
|
class ClaimUbicationFragment(
|
||||||
var entryPoint: String = ""
|
var entryPoint: String = ""
|
||||||
) : BaseFragment<FragmentGeneralBlackBinding, ClaimViewModel>(
|
) : BaseFragment<FragmentGeneralBlackBinding, ClaimViewModel>(
|
||||||
ClaimViewModel::class
|
ClaimViewModel::class
|
||||||
|
@ -31,7 +31,7 @@ class ClaimFragment(
|
||||||
private var claimAdapter: GeneralAdapter? = null
|
private var claimAdapter: GeneralAdapter? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = ClaimFragment(entryPoint)
|
fun newInstance(entryPoint: String) = ClaimUbicationFragment(entryPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
@ -73,13 +73,12 @@ class ClaimFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
responseadd.observe(viewLifecycleOwner, Observer {
|
responseadd.observe(viewLifecycleOwner) {
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
listClaims.clear()
|
listClaims.clear()
|
||||||
claimAdapter!!.notifyDataSetChanged()
|
|
||||||
showInputClaim()
|
showInputClaim()
|
||||||
|
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -107,7 +106,7 @@ class ClaimFragment(
|
||||||
val nameClaim: String = getTextScaned(listClaims.size + 1) + itemScaned
|
val nameClaim: String = getTextScaned(listClaims.size + 1) + itemScaned
|
||||||
customDialogList.setTitle(getTextToPosition(listClaims.size + 1))
|
customDialogList.setTitle(getTextToPosition(listClaims.size + 1))
|
||||||
listClaims.add(GeneralItem(itemScaned, nameClaim))
|
listClaims.add(GeneralItem(itemScaned, nameClaim))
|
||||||
claimAdapter!!.notifyDataSetChanged()
|
claimAdapter!!.notifyItemInserted(listClaims.size - 1)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,11 +129,18 @@ class ClaimFragment(
|
||||||
if (customDialogList.getValue().isNotEmpty()) {
|
if (customDialogList.getValue().isNotEmpty()) {
|
||||||
addItem(customDialogList.getValue())
|
addItem(customDialogList.getValue())
|
||||||
if (listClaims.size > 1) {
|
if (listClaims.size > 1) {
|
||||||
|
try {
|
||||||
viewModel.itemShelvingAddByClaim(
|
viewModel.itemShelvingAddByClaim(
|
||||||
listClaims.first().code!!.toInt(),
|
listClaims.first().code!!.toInt(),
|
||||||
customDialogList.getValue().uppercase()
|
customDialogList.getValue().uppercase()
|
||||||
)
|
)
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
getString(R.string.errorInput).toast(requireContext())
|
||||||
|
listClaims.clear()
|
||||||
|
claimAdapter!!.notifyItemRangeRemoved(0,1)
|
||||||
|
showInputClaim()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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 android.content.Context
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
|
@ -2174,7 +2174,7 @@ class CollectionFragment(
|
||||||
private fun showQuantityDialog(position: Int) {
|
private fun showQuantityDialog(position: Int) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
||||||
.setValue("").setOkButtonAdd(getString(R.string.Agregar)) {
|
.setValue("").setOkButtonAdd(getString(R.string.Agregar)) {
|
||||||
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
|
|
@ -2225,7 +2225,7 @@ class CollectionFragmentPicker(
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
|
|
||||||
private fun showQuantityDialog(position: Int) {
|
private fun showQuantityDialog(position: Int) {
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
||||||
.setValue("")
|
.setValue("")
|
||||||
|
|
||||||
.setOkButtonAdd(getString(R.string.Agregar)) {
|
.setOkButtonAdd(getString(R.string.Agregar)) {
|
||||||
|
|
|
@ -2145,7 +2145,7 @@ class CollectionFragmentPreChecker(
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
|
|
||||||
private fun showQuantityDialog(position: Int) {
|
private fun showQuantityDialog(position: Int) {
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
||||||
.setValue("")
|
.setValue("")
|
||||||
|
|
||||||
//Tarea4495
|
//Tarea4495
|
||||||
|
|
|
@ -9,6 +9,7 @@ import es.verdnatura.MobileApplication
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.SilexCallback
|
import es.verdnatura.domain.SilexCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
@ -225,7 +226,13 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<CollectionVO>) {
|
override fun onSuccess(response: Response<CollectionVO>) {
|
||||||
|
|
||||||
|
try {
|
||||||
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
|
_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(
|
fun collectionGetId(
|
||||||
ticketFk: Int,
|
ticketFk: Int,
|
||||||
sectorFk: Int,
|
sectorFk: Int,
|
||||||
|
@ -469,10 +474,11 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
fun collectionAddWithReservation(
|
fun collectionAddWithReservation(
|
||||||
item: Int,
|
item: Int,
|
||||||
quantity: Int,
|
quantity: Int,
|
||||||
ticketSelected: Int
|
ticketSelected: Int,
|
||||||
|
saleGroupFk :Int ?
|
||||||
) {
|
) {
|
||||||
salix.collectionAddWithReservation(
|
salix.collectionAddWithReservation(
|
||||||
params = arrayListOf(item, quantity, ticketSelected)
|
params = arrayListOf(item, quantity, ticketSelected, saleGroupFk)
|
||||||
).enqueue(object : SalixCallback<Any>(context) {
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_responseCollectionAddItem.value =
|
_responseCollectionAddItem.value =
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.app.AlertDialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View.GONE
|
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
@ -167,7 +166,7 @@ class CollectionShowTicketFragment(
|
||||||
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
binding.scanInput.setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
|
||||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||||
|
buttonPushedGetCollection = false
|
||||||
try {
|
try {
|
||||||
viewModel.getSales(
|
viewModel.getSales(
|
||||||
binding.scanInput.text.toString().toInt(), print = "0", type
|
binding.scanInput.text.toString().toInt(), print = "0", type
|
||||||
|
|
|
@ -33,7 +33,6 @@ class ControladorFragment :
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
|
|
||||||
binding.scanInput.visibility = VISIBLE
|
binding.scanInput.visibility = VISIBLE
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.controlticket)
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -78,14 +77,11 @@ class ControladorFragment :
|
||||||
)
|
)
|
||||||
.setOkButton(getString(R.string.aware)) {
|
.setOkButton(getString(R.string.aware)) {
|
||||||
customDialogWarning.dismiss()
|
customDialogWarning.dismiss()
|
||||||
viewModel.collectionTicketGet(
|
viewModel.getSales(
|
||||||
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
|
||||||
ConstAndValues.SECTORFK
|
|
||||||
),
|
|
||||||
collectionFk = binding.scanInput.text.toString()
|
collectionFk = binding.scanInput.text.toString()
|
||||||
.toInt(),
|
.toInt(),
|
||||||
print = "0",
|
print = false,
|
||||||
type = ConstAndValues.ON_CHECKING
|
source = ConstAndValues.ON_CHECKING
|
||||||
)
|
)
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
|
@ -94,13 +90,10 @@ class ControladorFragment :
|
||||||
}.show()
|
}.show()
|
||||||
customDialogWarning.currentFocus
|
customDialogWarning.currentFocus
|
||||||
} else {
|
} else {
|
||||||
viewModel.collectionTicketGet(
|
viewModel.getSales(
|
||||||
sectorFk = mobileApplication.dataStoreApp.readDataStoreKey(
|
|
||||||
ConstAndValues.SECTORFK
|
|
||||||
),
|
|
||||||
collectionFk = binding.scanInput.text.toString().toInt(),
|
collectionFk = binding.scanInput.text.toString().toInt(),
|
||||||
print = "0",
|
print = false,
|
||||||
type = ConstAndValues.ON_CHECKING
|
source = ConstAndValues.ON_CHECKING
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -116,17 +109,12 @@ class ControladorFragment :
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner) {
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, isError = true, isPlayed = false)
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (!goBack) navigateToCollectionList(it)
|
if (!goBack) navigateToCollectionList(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
}
|
|
||||||
|
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
import es.verdnatura.presentation.common.ResponseItemVO
|
||||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
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.CollectionVO
|
||||||
|
@ -32,33 +30,11 @@ class ControladorViewModel(var context: Context) : BaseViewModel(context) {
|
||||||
salix.getSalesFromTicketOrCollection(collectionFk, print, source)
|
salix.getSalesFromTicketOrCollection(collectionFk, print, source)
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SalixCallback<CollectionVO>(context) {
|
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>) {
|
override fun onSuccess(response: Response<CollectionVO>) {
|
||||||
if (response.body() != null) {
|
|
||||||
_collectionTicketList.value = response.body()?.let { it.map(context) }
|
_collectionTicketList.value = response.body()?.let { it.map(context) }
|
||||||
} else {
|
|
||||||
_collectionTicketList.value = CollectionVO(
|
|
||||||
0,
|
|
||||||
isError = true,
|
|
||||||
errorMessage = getMessageFromAllResponse(
|
|
||||||
nameofFunction(this),
|
|
||||||
response.message()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun collectionTicketGet(collectionFk: Int, sectorFk: Int, print: String, type: String) {
|
|
||||||
getSales(collectionFk, false, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
@ -26,7 +25,7 @@ import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragment
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class ControlVehiculoFragment(
|
class ControlVehiculoFragment(
|
||||||
var tagName: String = ""
|
private var tagName: String = ""
|
||||||
) : BaseFragment<FragmentVehiclecontrolBinding, ControlVehiculoViewModel>(
|
) : BaseFragment<FragmentVehiclecontrolBinding, ControlVehiculoViewModel>(
|
||||||
ControlVehiculoViewModel::class
|
ControlVehiculoViewModel::class
|
||||||
) {
|
) {
|
||||||
|
@ -86,15 +85,10 @@ class ControlVehiculoFragment(
|
||||||
val iconVehicleOut = ImageView(context)
|
val iconVehicleOut = ImageView(context)
|
||||||
iconVehicleOut.setImageResource(R.drawable.car_off)
|
iconVehicleOut.setImageResource(R.drawable.car_off)
|
||||||
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
|
|
||||||
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
iconHistory.tooltipText = getTooltip(R.drawable.ic_history_black_24dp)
|
||||||
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
|
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
|
||||||
iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
|
iconVehicleOut.tooltipText = getTooltip(R.drawable.car_off)
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
when (direction) {
|
when (direction) {
|
||||||
"OUT" -> {
|
"OUT" -> {
|
||||||
listIcons.remove(iconVehicleIn)
|
listIcons.remove(iconVehicleIn)
|
||||||
|
@ -141,7 +135,7 @@ class ControlVehiculoFragment(
|
||||||
|
|
||||||
.setKoButton(getString(R.string.cancel)) {
|
.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
|
if (tagName == HistoricoVehiculoFragment.TAG) {
|
||||||
ma.onMyBackPressed()
|
ma.onMyBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,20 +165,25 @@ class ControlVehiculoFragment(
|
||||||
|
|
||||||
private fun insertControlTimeVehicle(plateNumber: String, direction: String) {
|
private fun insertControlTimeVehicle(plateNumber: String, direction: String) {
|
||||||
|
|
||||||
if (direction.equals("HISTORY")) {
|
when (direction) {
|
||||||
|
"HISTORY" -> {
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(title = getString(R.string.titleHistoricalHide)), plateNumber
|
PasillerosItemVO(title = getString(R.string.titleHistoricalHide)), plateNumber
|
||||||
)
|
)
|
||||||
} else if (direction.equals("IN")) {
|
}
|
||||||
viewModel.machineWorker_add(plateNumber)
|
|
||||||
|
|
||||||
} else if (direction.equals("OUT")) {
|
"IN" -> {
|
||||||
viewModel.machineWorker_update(plateNumber)
|
viewModel.machineWorkerUpdate(plateNumber)
|
||||||
|
}
|
||||||
|
|
||||||
} else if (direction.equals("")) {
|
"OUT" -> {
|
||||||
|
viewModel.machineWorkerUpdate(plateNumber)
|
||||||
|
}
|
||||||
|
|
||||||
|
"" -> {
|
||||||
ma.openFragmentPickers(true)
|
ma.openFragmentPickers(true)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
customDialogInput.setValue("")
|
customDialogInput.setValue("")
|
||||||
scanRequest()
|
scanRequest()
|
||||||
|
@ -201,6 +200,7 @@ class ControlVehiculoFragment(
|
||||||
try {
|
try {
|
||||||
requireActivity().hideKeyboard()
|
requireActivity().hideKeyboard()
|
||||||
} catch (e: Exception) {
|
} 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 (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
|
|
||||||
if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
|
if (tagName == HistoricoVehiculoFragment.TAG) {
|
||||||
showOptionsHistorical(binding.scanInput.text.toString())
|
showOptionsHistorical(binding.scanInput.text.toString())
|
||||||
} else {
|
} else {
|
||||||
showOptionsVehicleControl(binding.scanInput.text.toString())
|
showOptionsVehicleControl(binding.scanInput.text.toString())
|
||||||
|
@ -236,7 +236,7 @@ class ControlVehiculoFragment(
|
||||||
|
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
|
customDialogThreeButtons.setDescription(getString(R.string.doVehiclePlate) + plate + "?")
|
||||||
.setValue(plate)
|
.setValue(plate)
|
||||||
if (isWorkedTimed.equals("UNREGISTERED")) {
|
if (isWorkedTimed == "UNREGISTERED") {
|
||||||
customDialogThreeButtons.setOkButtonTwo("COGER") {
|
customDialogThreeButtons.setOkButtonTwo("COGER") {
|
||||||
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
|
if (customDialogThreeButtons.getValue().trim().isEmpty()) {
|
||||||
getString(R.string.returnScan).toast(requireContext())
|
getString(R.string.returnScan).toast(requireContext())
|
||||||
|
@ -296,44 +296,23 @@ class ControlVehiculoFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
responseinsert.observe(viewLifecycleOwner) {
|
responseUpdate.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)
|
ma.openFragmentPickers(false)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
responseControl.observe(viewLifecycleOwner) {
|
||||||
}
|
|
||||||
|
|
||||||
}
|
if (it == "1") {
|
||||||
|
|
||||||
responsecontrol.observe(viewLifecycleOwner) {
|
|
||||||
|
|
||||||
if (it.response == "1") {
|
|
||||||
isWorkedTimed = "REGISTERED"
|
isWorkedTimed = "REGISTERED"
|
||||||
setToolBar("OUT")
|
setToolBar("OUT")
|
||||||
|
|
||||||
if (!tagName.equals(SacadorFragment.TAG)) {
|
if (tagName != SacadorFragment.TAG) {
|
||||||
ma.openFragmentPickers(false)
|
ma.openFragmentPickers(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (it.response == "0") {
|
if (it == "0") {
|
||||||
setToolBar("IN")
|
setToolBar("IN")
|
||||||
|
|
||||||
customDialogInput.setTitle(getString(R.string.vehiclecontrol))
|
customDialogInput.setTitle(getString(R.string.vehiclecontrol))
|
||||||
|
|
|
@ -3,11 +3,9 @@ package es.verdnatura.presentation.view.feature.controlvehiculo.fragment
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.view.View.INVISIBLE
|
||||||
import android.view.View.*
|
import android.view.View.VISIBLE
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
|
import es.verdnatura.databinding.FragmentVehiclecontrolUserBinding
|
||||||
|
@ -34,7 +32,6 @@ class ControlVehiculoUsuarioFragment(
|
||||||
fun newInstance(vUserFK: Int) = ControlVehiculoUsuarioFragment(vUserFK)
|
fun newInstance(vUserFK: Int) = ControlVehiculoUsuarioFragment(vUserFK)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontroluser)
|
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclecontroluser)
|
||||||
goBack = false
|
goBack = false
|
||||||
|
@ -44,7 +41,6 @@ class ControlVehiculoUsuarioFragment(
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
|
|
||||||
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||||
|
@ -73,7 +69,7 @@ class ControlVehiculoUsuarioFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getExtensionFromUser() {
|
private fun getExtensionFromUser() {
|
||||||
viewModel.sip_getExtensionSalix(vUserFK)
|
viewModel.sipGetExtensionSalix(vUserFK)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
@ -86,9 +82,9 @@ class ControlVehiculoUsuarioFragment(
|
||||||
userFk = mobileApplication.userId!!
|
userFk = mobileApplication.userId!!
|
||||||
|
|
||||||
if (userFk == vUserFK) {
|
if (userFk == vUserFK) {
|
||||||
var androidId: String = mobileApplication.dataStoreApp.readDataStoreKey(ANDROID_ID)
|
val androidId: String = mobileApplication.dataStoreApp.readDataStoreKey(ANDROID_ID)
|
||||||
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
||||||
viewModel.deviceProduction_getnameDevice(
|
viewModel.deviceProductionGetnameDevice(
|
||||||
androidId
|
androidId
|
||||||
)
|
)
|
||||||
viewModel.deviceProductionUserGetWorker(
|
viewModel.deviceProductionUserGetWorker(
|
||||||
|
@ -131,13 +127,8 @@ class ControlVehiculoUsuarioFragment(
|
||||||
|
|
||||||
responsemachine.observe(viewLifecycleOwner) {
|
responsemachine.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (it.response == "false") {
|
if (it.response == "false") {
|
||||||
if (it.type.equals("getWorker")) {
|
if (it.type == "getWorker") {
|
||||||
binding.assignedDevicename.text =
|
binding.assignedDevicename.text =
|
||||||
getString(R.string.noAssigned)
|
getString(R.string.noAssigned)
|
||||||
}
|
}
|
||||||
|
@ -151,26 +142,24 @@ class ControlVehiculoUsuarioFragment(
|
||||||
"getWorkerPlate" -> binding.registeredVehiclecontrol.text = it.response
|
"getWorkerPlate" -> binding.registeredVehiclecontrol.text = it.response
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
|
responseGetExtensionFromUserId.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (it.isError) {
|
if (it!="") {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.noSIP) + it.errorMessage + getString(R.string.user) + vUserFK,
|
getString(R.string.noSIP) +"."+ getString(R.string.user) + vUserFK,
|
||||||
isError = true,
|
isError = true,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
callPicker(it.toString())
|
||||||
callPicker(it.response)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,70 +12,44 @@ import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
import es.verdnatura.presentation.common.ResponseItemMachineControl
|
import es.verdnatura.presentation.common.ResponseItemMachineControl
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
|
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _responseinsert by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseUpdate by lazy { MutableLiveData<Any>() }
|
||||||
val responseinsert: LiveData<ResponseItemVO>
|
val responseUpdate: LiveData<Any>
|
||||||
get() = _responseinsert
|
get() = _responseUpdate
|
||||||
|
|
||||||
private val _responsecontrol by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseControl by lazy { MutableLiveData<String>() }
|
||||||
val responsecontrol: LiveData<ResponseItemVO>
|
val responseControl: LiveData<String>
|
||||||
get() = _responsecontrol
|
get() = _responseControl
|
||||||
|
|
||||||
private val _responsemachine by lazy { MutableLiveData<ResponseItemMachineControl>() }
|
private val _responsemachine by lazy { MutableLiveData<ResponseItemMachineControl>() }
|
||||||
val responsemachine: LiveData<ResponseItemMachineControl>
|
val responsemachine: LiveData<ResponseItemMachineControl>
|
||||||
get() = _responsemachine
|
get() = _responsemachine
|
||||||
|
|
||||||
private val _responseGetExtensionFromUserId by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseGetExtensionFromUserId by lazy { MutableLiveData<Any>() }
|
||||||
val responseGetExtensionFromUserId: LiveData<ResponseItemVO>
|
val responseGetExtensionFromUserId: LiveData<Any>
|
||||||
get() = _responseGetExtensionFromUserId
|
get() = _responseGetExtensionFromUserId
|
||||||
|
fun machineWorkerUpdate(
|
||||||
fun machineWorker_add(
|
|
||||||
plate: String
|
plate: String
|
||||||
) {
|
) {
|
||||||
//tarea 6276 vehiculo
|
//tarea 6276 vehiculo
|
||||||
salix.machineWorkerUpdateInTime(hashMapOf("plate" to plate))
|
salix.machineWorkerUpdateInTime(hashMapOf("plate" to plate))
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.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>) {
|
||||||
|
|
||||||
if (response.body().toString() == "false") {
|
_responseUpdate.value = response.body()
|
||||||
_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
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun machineWorker_update(
|
/* fun machineWorker_update(
|
||||||
plate: String
|
plate: String
|
||||||
) {
|
) {
|
||||||
//Tarea 6276 //vehiculo
|
//Tarea 6276 //vehiculo
|
||||||
|
@ -110,25 +84,25 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}*/
|
||||||
|
|
||||||
fun workerMachineryIsRegistered(userId: Int) {
|
fun workerMachineryIsRegistered(userId: Int) {
|
||||||
salix.workerMachineryIsRegistered(arrayListOf(userId))
|
salix.workerMachineryIsRegistered(arrayListOf(userId))
|
||||||
.enqueue(object : SalixCallback<String>(context) {
|
.enqueue(object : SalixCallback<String>(context) {
|
||||||
override fun onSuccess(response: Response<String>) {
|
override fun onSuccess(response: Response<String>) {
|
||||||
_responsecontrol.value =
|
_responseControl.value =
|
||||||
ResponseItemVO(isError = false, response = response.body()!!)
|
response.body()!!
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun deviceProduction_getnameDevice(android_id: String) {
|
fun deviceProductionGetnameDevice(androidId: String) {
|
||||||
|
|
||||||
salix.deviceProductionsGetName(
|
salix.deviceProductionsGetName(
|
||||||
Gson().toJson(
|
Gson().toJson(
|
||||||
Filter(
|
Filter(
|
||||||
mapOf("id" to true),
|
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)
|
arrayListOf(userId)
|
||||||
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||||
override fun onSuccess(response: Response<List<JsonObject>>) {
|
override fun onSuccess(response: Response<List<JsonObject>>) {
|
||||||
var myArray = response.body()
|
val myArray = response.body()
|
||||||
_responsemachine.value =
|
_responsemachine.value =
|
||||||
ResponseItemMachineControl(
|
ResponseItemMachineControl(
|
||||||
isError = false,
|
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
|
workerId: Int
|
||||||
) {
|
) {
|
||||||
salix.sip_getExtension(
|
salix.sip_getExtension(
|
||||||
workerId
|
workerId
|
||||||
).enqueue(object : SalixCallback<Any>(context) {
|
).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>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
|
||||||
if (response.body() != null) {
|
_responseGetExtensionFromUserId.value = if (response.body() != null) {
|
||||||
_responseGetExtensionFromUserId.value = ResponseItemVO(
|
JSONObject(response.body()!!.toString()).get("extension").toString()
|
||||||
isError = false,
|
|
||||||
response = JSONObject(response.body()!!.toString()).get("extension")
|
|
||||||
.toString(),
|
|
||||||
errorMessage = ""
|
|
||||||
)
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_responseGetExtensionFromUserId.value = ResponseItemVO(
|
""
|
||||||
isError = true,
|
|
||||||
response = "",
|
|
||||||
errorMessage = response.message()!!
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,10 @@ class ExpeditionSummaryAdapter(
|
||||||
onAddressRowClickListener.onAddressRowClickListener(items[position])
|
onAddressRowClickListener.onAddressRowClickListener(items[position])
|
||||||
|
|
||||||
}
|
}
|
||||||
holder.binding.txtConsignatario.setOnClickListener {
|
/* holder.binding.txtConsignatario.setOnClickListener {
|
||||||
positionSelected = holder.absoluteAdapterPosition
|
onAddressRowClickListener.onAddressRowClickListener(items[position])
|
||||||
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class ItemHolder(
|
inner class ItemHolder(
|
||||||
|
|
|
@ -34,18 +34,20 @@ class InfoFragment(var title: String) :
|
||||||
|
|
||||||
companyInfoList.observe(viewLifecycleOwner) {
|
companyInfoList.observe(viewLifecycleOwner) {
|
||||||
if (it.list.isNotEmpty()) {
|
if (it.list.isNotEmpty()) {
|
||||||
binding.itemName.text = it.list[0]?.name
|
binding.itemName.text = it.list[0].name
|
||||||
binding.itemNif.text = it.list[0]?.nif
|
binding.itemNif.text = it.list[0].nif
|
||||||
binding.itemAdress.text = it.list[0]?.street + "-" + it.list[0]?.city
|
binding.itemAdress.text =
|
||||||
|
getString(R.string.itemAddress, it.list[0].street, it.list[0].city)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
freelanceInfoList.observe(viewLifecycleOwner) {
|
freelanceInfoList.observe(viewLifecycleOwner) {
|
||||||
if (it.list.isNotEmpty()) {
|
if (it.list.isNotEmpty()) {
|
||||||
binding.linearInfoFreelance.visibility=View.VISIBLE
|
binding.linearInfoFreelance.visibility=View.VISIBLE
|
||||||
binding.freelanceName.text = it.list[0]?.name
|
binding.freelanceName.text = it.list[0].name
|
||||||
binding.freelanceNif.text = it.list[0]?.nif
|
binding.freelanceNif.text = it.list[0].nif
|
||||||
binding.freelanceAddress.text = it.list[0]?.street + "-" + it.list[0]?.city
|
binding.freelanceAddress.text = getString(R.string.itemAddress, it.list[0].street, it.list[0].city)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.fragments
|
package es.verdnatura.presentation.view.feature.delivery.fragments
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentExpeditionLogDeliveryBinding
|
import es.verdnatura.databinding.FragmentExpeditionLogDeliveryBinding
|
||||||
|
@ -54,7 +52,7 @@ class LogExpeditionFragment(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
|
@ -65,7 +63,6 @@ class LogExpeditionFragment(
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
|
|
||||||
binding.mainToolbar.switchButton.tooltipText = getString(R.string.expeditionMarkFound)
|
binding.mainToolbar.switchButton.tooltipText = getString(R.string.expeditionMarkFound)
|
||||||
|
@ -73,10 +70,7 @@ class LogExpeditionFragment(
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
val iconDelivery = ImageView(context)
|
val iconDelivery = ImageView(context)
|
||||||
iconDelivery.setImageResource(R.drawable.ic_delivery_truck)
|
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)
|
listIcons.add(iconDelivery)
|
||||||
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
|
@ -112,7 +106,11 @@ class LogExpeditionFragment(
|
||||||
viewModel.expeditionGetLog(binding.scanInput.toInt())
|
viewModel.expeditionGetLog(binding.scanInput.toInt())
|
||||||
originalItem = binding.scanInput.toInt()
|
originalItem = binding.scanInput.toInt()
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
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) {
|
} catch (ex: Exception) {
|
||||||
getString(R.string.errorScanExpedition).toast(context, Toast.LENGTH_SHORT)
|
getString(R.string.errorScanExpedition).toast(context, Toast.LENGTH_SHORT)
|
||||||
}
|
}
|
||||||
|
@ -124,14 +122,14 @@ class LogExpeditionFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
expeditionInfoList.observe(viewLifecycleOwner) {
|
expeditionInfoList.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
createList(it.list)
|
createList(it.list)
|
||||||
setSwitchButon()
|
setSwitchButon()
|
||||||
viewModel.get_routesFromExpedition(originalItem)
|
setSwitchButon()
|
||||||
|
viewModel.getRoutesFromExpedition(originalItem)
|
||||||
}
|
}
|
||||||
routeInfoList.observe(viewLifecycleOwner) {
|
routeInfoList.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
|
@ -152,10 +150,9 @@ class LogExpeditionFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setSwitchButon() {
|
private fun setSwitchButon() {
|
||||||
|
|
||||||
binding.mainToolbar.switchButton.setOnCheckedChangeListener { buttonView, isChecked ->
|
binding.mainToolbar.switchButton.setOnCheckedChangeListener { _, isChecked ->
|
||||||
binding.mainToolbar.switchButton.tooltipText =
|
binding.mainToolbar.switchButton.tooltipText =
|
||||||
if (isChecked) getString(R.string.expeditionMarkLost) else getString(R.string.expeditionMarkFound)
|
if (isChecked) getString(R.string.expeditionMarkLost) else getString(R.string.expeditionMarkFound)
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.fragments
|
package es.verdnatura.presentation.view.feature.delivery.fragments
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
@ -53,7 +51,7 @@ class RoutesFragment(
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_route
|
override fun getLayoutId(): Int = R.layout.fragment_route
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
super.init()
|
super.init()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -67,6 +65,7 @@ class RoutesFragment(
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
pendingOperations()
|
pendingOperations()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun pendingOperations() {
|
private fun pendingOperations() {
|
||||||
|
|
||||||
db = database(requireContext().applicationContext)
|
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(
|
viewModel.expeditionStateAddSalix(
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "DELIVERED" })
|
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "DELIVERED" })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (pendingExpeditionSend.filter { it.stateCode == "ON DELIVERY" }
|
if (pendingExpeditionSend.any { it.stateCode == "ON DELIVERY" }) {
|
||||||
.isNotEmpty()) {
|
|
||||||
viewModel.expeditionStateAddSalix(
|
viewModel.expeditionStateAddSalix(
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "ON DELIVERY" })
|
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "ON DELIVERY" })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (pendingExpeditionSend.filter { it.stateCode == "LOST" }.isNotEmpty()) {
|
if (pendingExpeditionSend.any { it.stateCode == "LOST" }) {
|
||||||
viewModel.expeditionStateAddSalix(
|
viewModel.expeditionStateAddSalix(
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "LOST" })
|
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "LOST" })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (pendingExpeditionSend.filter { it.stateCode == "FOUND" }.isNotEmpty()) {
|
if (pendingExpeditionSend.any { it.stateCode == "FOUND" }) {
|
||||||
viewModel.expeditionStateAddSalix(
|
viewModel.expeditionStateAddSalix(
|
||||||
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "FOUND" })
|
hashMapOf("expeditions" to pendingExpeditionSend.filter { it.stateCode == "FOUND" })
|
||||||
)
|
)
|
||||||
|
@ -133,8 +131,6 @@ class RoutesFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
|
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
|
||||||
|
@ -152,11 +148,9 @@ class RoutesFragment(
|
||||||
iconRefresh.setImageResource(R.drawable.ic_info_refresh)
|
iconRefresh.setImageResource(R.drawable.ic_info_refresh)
|
||||||
iconSearch.setImageResource(R.drawable.expedition_find)
|
iconSearch.setImageResource(R.drawable.expedition_find)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
iconInfo.tooltipText = getTooltip(R.drawable.ic_info_delivery)
|
iconInfo.tooltipText = getTooltip(R.drawable.ic_info_delivery)
|
||||||
iconRefresh.tooltipText = getTooltip(R.drawable.ic_info_refresh)
|
iconRefresh.tooltipText = getTooltip(R.drawable.ic_info_refresh)
|
||||||
iconSearch.tooltipText = getTooltip(R.drawable.expedition_find)
|
iconSearch.tooltipText = getTooltip(R.drawable.expedition_find)
|
||||||
}
|
|
||||||
listIcons.add(iconInfo)
|
listIcons.add(iconInfo)
|
||||||
listIcons.add(iconRefresh)
|
listIcons.add(iconRefresh)
|
||||||
listIcons.add(iconSearch)
|
listIcons.add(iconSearch)
|
||||||
|
@ -223,7 +217,6 @@ class RoutesFragment(
|
||||||
adapter!!.updateList(filteredList)
|
adapter!!.updateList(filteredList)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadRouteList.observe(viewLifecycleOwner) { event ->
|
loadRouteList.observe(viewLifecycleOwner) { event ->
|
||||||
|
@ -249,14 +242,14 @@ class RoutesFragment(
|
||||||
|
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
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 {
|
} else {
|
||||||
deleteSignTickets(it.response)
|
deleteSignTickets(it.response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
responseLoadList.observe(viewLifecycleOwner) {
|
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)
|
ma.onApplicationEventAnimation(View.INVISIBLE)
|
||||||
createListRoutes(mutableListOf(), getSaved = true)
|
createListRoutes(mutableListOf(), getSaved = true)
|
||||||
}
|
}
|
||||||
|
@ -283,7 +276,7 @@ class RoutesFragment(
|
||||||
db.routesDao().getAll() as MutableList<RouteInfo>
|
db.routesDao().getAll() as MutableList<RouteInfo>
|
||||||
} else {
|
} else {
|
||||||
db.routesDao().delete()
|
db.routesDao().delete()
|
||||||
db.routesDao().insert(list!!)
|
db.routesDao().insert(list)
|
||||||
list
|
list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +324,7 @@ class RoutesFragment(
|
||||||
binding.routeRecyclerview.adapter = adapter
|
binding.routeRecyclerview.adapter = adapter
|
||||||
binding.routeRecyclerview.layoutManager =
|
binding.routeRecyclerview.layoutManager =
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
adapter!!.notifyDataSetChanged()
|
// adapter!!.notifyDataSetChanged()
|
||||||
if (!binding.scanInput.text.isNullOrBlank()) {
|
if (!binding.scanInput.text.isNullOrBlank()) {
|
||||||
filteredList(binding.scanInput.text.toString())
|
filteredList(binding.scanInput.text.toString())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.fragments
|
package es.verdnatura.presentation.view.feature.delivery.fragments
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
@ -43,7 +41,7 @@ class SummaryFragment(
|
||||||
private var counterResponse = 0
|
private var counterResponse = 0
|
||||||
private var positionOnScreen = 0
|
private var positionOnScreen = 0
|
||||||
private var addressFkSelected = 0
|
private var addressFkSelected = 0
|
||||||
private var routeSelected = 161059
|
private var routeSelected = 0
|
||||||
private var isScanning = false
|
private var isScanning = false
|
||||||
private var positionSelected = -1
|
private var positionSelected = -1
|
||||||
|
|
||||||
|
@ -54,7 +52,6 @@ class SummaryFragment(
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_expedition_summary
|
override fun getLayoutId(): Int = R.layout.fragment_expedition_summary
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
super.init()
|
super.init()
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -77,7 +74,7 @@ class SummaryFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun callBack(routeGetexpeditionsummary: Unit) {
|
private fun callBack(routeGetexpeditionsummary: Unit) {
|
||||||
routeGetexpeditionsummary
|
return routeGetexpeditionsummary
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setViews() {
|
private fun setViews() {
|
||||||
|
@ -91,7 +88,6 @@ class SummaryFragment(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
|
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
|
||||||
|
@ -107,10 +103,9 @@ class SummaryFragment(
|
||||||
iconLoad.setImageResource(R.drawable.camion)
|
iconLoad.setImageResource(R.drawable.camion)
|
||||||
iconExit.setImageResource(R.drawable.exit)
|
iconExit.setImageResource(R.drawable.exit)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
iconLoad.tooltipText = getTooltip(R.drawable.camion)
|
iconLoad.tooltipText = getTooltip(R.drawable.camion)
|
||||||
iconExit.tooltipText = getTooltip(R.drawable.exit)
|
iconExit.tooltipText = getTooltip(R.drawable.exit)
|
||||||
}
|
|
||||||
listIcons.add(iconLoad)
|
listIcons.add(iconLoad)
|
||||||
listIcons.add(iconExit)
|
listIcons.add(iconExit)
|
||||||
|
|
||||||
|
@ -139,28 +134,23 @@ class SummaryFragment(
|
||||||
|
|
||||||
private fun openLoadUnLoad(adress: Int) {
|
private fun openLoadUnLoad(adress: Int) {
|
||||||
|
|
||||||
var entryPoint = Gson().toJson(
|
val entryPoint = Gson().toJson(
|
||||||
mutableMapOf(
|
mutableMapOf(
|
||||||
"route" to routeSelected,
|
"route" to routeSelected, "address" to adress
|
||||||
"address" to adress
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
ma.onPasillerosItemClickListener(
|
ma.onPasillerosItemClickListener(
|
||||||
PasillerosItemVO(title = getString(R.string.titleLoadTruck)),
|
PasillerosItemVO(title = getString(R.string.titleLoadTruck)), entryPoint
|
||||||
entryPoint
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setExpeditionsState(
|
private fun setExpeditionsState(
|
||||||
list: MutableList<ExpeditionInfoLoadUnload>,
|
list: MutableList<ExpeditionInfoLoadUnload>, state: String, address: Int
|
||||||
state: String,
|
|
||||||
address: Int
|
|
||||||
) {
|
) {
|
||||||
val listExpedition = list.filter { it.addressFk == address }.map { l ->
|
val listExpedition = list.filter { it.addressFk == address }.map { l ->
|
||||||
ExpeditionSalix(
|
ExpeditionSalix(
|
||||||
expeditionFk = l.id,
|
expeditionFk = l.id, stateCode = if (l.code == state) {
|
||||||
stateCode = if (l.code == state) {
|
|
||||||
state
|
state
|
||||||
} else {
|
} else {
|
||||||
"FOUND"
|
"FOUND"
|
||||||
|
@ -176,8 +166,7 @@ class SummaryFragment(
|
||||||
hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state })
|
hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state })
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
/* callBack(viewModel.expeditionState_add(list.filter { it.addressFk == address }
|
|
||||||
.filter { it.code == state }, state))*/
|
|
||||||
isScanning = false
|
isScanning = false
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -186,20 +175,15 @@ class SummaryFragment(
|
||||||
alertDialog.setMessage(getString(R.string.expeditionTotal))
|
alertDialog.setMessage(getString(R.string.expeditionTotal))
|
||||||
alertDialog.setButton(
|
alertDialog.setButton(
|
||||||
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.save)
|
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.save)
|
||||||
) { dialog, which ->
|
) { _, _ ->
|
||||||
|
|
||||||
counterCalls = 1
|
counterCalls = 1
|
||||||
viewModel.expeditionStateAddSalix(hashMapOf("expeditions" to listExpedition.filter { it.stateCode == state }))
|
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(
|
alertDialog.setButton(
|
||||||
android.app.AlertDialog.BUTTON_NEUTRAL, getString(R.string.find)
|
android.app.AlertDialog.BUTTON_NEUTRAL, getString(R.string.find)
|
||||||
) { dialog, which ->
|
) { _, _ ->
|
||||||
//createList(list.sortedByDescending { it.code })
|
//createList(list.sortedByDescending { it.code })
|
||||||
}
|
}
|
||||||
alertDialog.show()
|
alertDialog.show()
|
||||||
|
@ -219,8 +203,7 @@ class SummaryFragment(
|
||||||
isScanning = true
|
isScanning = true
|
||||||
try {
|
try {
|
||||||
markExpedition(
|
markExpedition(
|
||||||
binding.scanInput.text.toString().toInt(),
|
binding.scanInput.text.toString().toInt(), state
|
||||||
"ON DELIVERY"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
@ -237,10 +220,9 @@ class SummaryFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun markExpedition(expedNumber: Int, state: String) {
|
private fun markExpedition(expedNumber: Int, state: String) {
|
||||||
|
|
||||||
var found = false
|
var found = false
|
||||||
if (myList.filter { it.addressFk == addressFkSelected }.filter { it.id == expedNumber }
|
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)
|
ma.messageWithSound(getString(R.string.expeditionMarked), null, true)
|
||||||
} else {
|
} else {
|
||||||
for (exped in myList.filter { it.addressFk == addressFkSelected }) {
|
for (exped in myList.filter { it.addressFk == addressFkSelected }) {
|
||||||
|
@ -252,9 +234,9 @@ class SummaryFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found) {
|
if (found) {
|
||||||
ma.messageWithSound("", false, true, isToasted = false)
|
ma.messageWithSound(message ="", isError = false, isPlayed = true, isToasted = false)
|
||||||
} else {
|
} 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() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
|
||||||
|
@ -288,7 +269,7 @@ class SummaryFragment(
|
||||||
}
|
}
|
||||||
responseStateAdd.observe(viewLifecycleOwner) {
|
responseStateAdd.observe(viewLifecycleOwner) {
|
||||||
if (!it.isError) {
|
if (!it.isError) {
|
||||||
counterResponse = counterResponse + 1
|
counterResponse += 1
|
||||||
if (counterResponse == counterCalls) {
|
if (counterResponse == counterCalls) {
|
||||||
callBack(viewModel.routeGetExpeditionSummary(routeSelected))
|
callBack(viewModel.routeGetExpeditionSummary(routeSelected))
|
||||||
counterResponse = 0
|
counterResponse = 0
|
||||||
|
@ -310,7 +291,7 @@ class SummaryFragment(
|
||||||
|
|
||||||
for ((indice, elemento) in myListSummary.withIndex()) {
|
for ((indice, elemento) in myListSummary.withIndex()) {
|
||||||
if (indice >= startIndex) {
|
if (indice >= startIndex) {
|
||||||
// Realiza las operaciones necesarias con el elemento
|
|
||||||
if (myList.filter { it.addressFk == elemento.addressFk }
|
if (myList.filter { it.addressFk == elemento.addressFk }
|
||||||
.filter { it.code == state }.size != myList.filter { it.addressFk == elemento.addressFk }.size) {
|
.filter { it.code == state }.size != myList.filter { it.addressFk == elemento.addressFk }.size) {
|
||||||
addressFkSelected = myListSummary[indice].addressFk
|
addressFkSelected = myListSummary[indice].addressFk
|
||||||
|
@ -345,7 +326,6 @@ class SummaryFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
if (addressFkSelected != item.addressFk && isScanning) {
|
if (addressFkSelected != item.addressFk && isScanning) {
|
||||||
//actualiza el estado de las expediciones escaneadas
|
|
||||||
setExpeditionsState(myList, state, addressFkSelected)
|
setExpeditionsState(myList, state, addressFkSelected)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -358,13 +338,12 @@ class SummaryFragment(
|
||||||
override fun onItemImageLoadRowClickListener(item: ExpeditionInfoSummary) {
|
override fun onItemImageLoadRowClickListener(item: ExpeditionInfoSummary) {
|
||||||
openLoadUnLoad(item.addressFk)
|
openLoadUnLoad(item.addressFk)
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
binding.expeditionSummaryRecyclerview.adapter = adapter
|
binding.expeditionSummaryRecyclerview.adapter = adapter
|
||||||
binding.expeditionSummaryRecyclerview.layoutManager =
|
binding.expeditionSummaryRecyclerview.layoutManager =
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
adapter!!.notifyDataSetChanged()
|
// adapter!!.notifyDataSetChanged()
|
||||||
//tarea 7278
|
//tarea 7278
|
||||||
//adapter!!.changePositionSelected(3)
|
//adapter!!.changePositionSelected(3)
|
||||||
}
|
}
|
||||||
|
@ -402,10 +381,13 @@ class SummaryFragment(
|
||||||
if (::myList.isInitialized) {
|
if (::myList.isInitialized) {
|
||||||
val countMarked =
|
val countMarked =
|
||||||
myList.filter { it.addressFk == addressFkSelected }.filter { it.code == state }.size
|
myList.filter { it.addressFk == addressFkSelected }.filter { it.code == state }.size
|
||||||
binding.mainToolbar.toolbarTitle.text = "R:${routeSelected} C:${addressFkSelected} "
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
binding.mainToolbar.toolbarSubtitle.text = "${
|
getString(R.string.routeTxtDouble, routeSelected, addressFkSelected)
|
||||||
countMarked
|
binding.mainToolbar.toolbarSubtitle.text = getString(
|
||||||
}/${myList.filter { it.addressFk == addressFkSelected }.size}"
|
R.string.subTitleRouteDouble,
|
||||||
|
countMarked,
|
||||||
|
myList.filter { it.addressFk == addressFkSelected }.size
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentTicketsBinding
|
import es.verdnatura.databinding.FragmentTicketsBinding
|
||||||
import es.verdnatura.db.DeliveryDatabase
|
import es.verdnatura.db.DeliveryDatabase
|
||||||
import es.verdnatura.domain.ConstAndValues.TOKEN
|
import es.verdnatura.domain.ConstAndValues.TOKEN
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
@ -81,7 +82,8 @@ class TicketsFragment(
|
||||||
binding.mainToolbar.toolbarTitle.text = route.name
|
binding.mainToolbar.toolbarTitle.text = route.name
|
||||||
viewModel.getTickets(route.id)
|
viewModel.getTickets(route.id)
|
||||||
db = database(requireContext().applicationContext)
|
db = database(requireContext().applicationContext)
|
||||||
|
println("route started ${route.started}")
|
||||||
|
println("route finished ${route.finished}")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setTitle() {
|
private fun setTitle() {
|
||||||
|
@ -96,6 +98,9 @@ class TicketsFragment(
|
||||||
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
ma.hideBottomNavigation(View.GONE)
|
ma.hideBottomNavigation(View.GONE)
|
||||||
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
|
ma.onMyBackPressed()
|
||||||
|
}
|
||||||
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
|
binding.mainToolbar.toolbarSubtitle.setTextColor(requireContext().getColor((R.color.verdnatura_pumpkin_orange)))
|
||||||
binding.mainToolbar.toolbarTitle.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarTitle.visibility = View.VISIBLE
|
||||||
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
||||||
|
@ -135,8 +140,15 @@ class TicketsFragment(
|
||||||
showSigned = !showSigned
|
showSigned = !showSigned
|
||||||
changeVisibleSettings(showSigned)
|
changeVisibleSettings(showSigned)
|
||||||
changeColorIcon(iconSettings.drawable, showSigned)
|
changeColorIcon(iconSettings.drawable, showSigned)
|
||||||
binding.kmStart.setText(route?.kmStart?.toString())
|
binding.kmStart.setText(route.kmStart?.toString())
|
||||||
binding.kmEnd.setText(route?.kmEnd?.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,27 +240,30 @@ class TicketsFragment(
|
||||||
|
|
||||||
binding.kmStart.setText(route.kmStart.toString())
|
binding.kmStart.setText(route.kmStart.toString())
|
||||||
binding.kmEnd.setText(route.kmEnd.toString())
|
binding.kmEnd.setText(route.kmEnd.toString())
|
||||||
binding.hourInit.setText(getHourDay(route.started))
|
|
||||||
binding.hourEnd.setText(getHourDay(route.finished))
|
|
||||||
|
|
||||||
binding.saveButton.setOnClickListener {
|
binding.saveButton.setOnClickListener {
|
||||||
route.kmStart = binding.kmStart.text.toString().toLong()
|
route.kmStart = binding.kmStart.text.toString().toLong()
|
||||||
route.kmEnd = binding.kmEnd.text.toString().toLong()
|
route.kmEnd = binding.kmEnd.text.toString().toLong()
|
||||||
route.started = addDateToTime(binding.hourInit.text.toString())
|
route.started = addDateToTime(binding.hourInit.text.toString())
|
||||||
route.finished = addDateToTime(binding.hourEnd.text.toString())
|
route.finished = addDateToTime(binding.hourEnd.text.toString())
|
||||||
|
println()
|
||||||
viewModel.routeUpdate(route)
|
viewModel.routeUpdate(route)
|
||||||
}
|
}
|
||||||
binding.hourInit.setOnFocusChangeListener { view, b ->
|
binding.hourInit.setOnFocusChangeListener { _, b ->
|
||||||
if (b) {
|
if (b) {
|
||||||
showTimePicker(binding.hourInit)
|
showTimePicker(binding.hourInit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
binding.hourEnd.setOnFocusChangeListener { _, b ->
|
||||||
binding.hourEnd.setOnClickListener {
|
if (b) {
|
||||||
showTimePicker(binding.hourEnd)
|
showTimePicker(binding.hourEnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* binding.hourEnd.setOnClickListener {
|
||||||
|
showTimePicker(binding.hourEnd)
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadRouteList.observe(viewLifecycleOwner) { event ->
|
loadRouteList.observe(viewLifecycleOwner) { event ->
|
||||||
|
@ -267,7 +282,7 @@ class TicketsFragment(
|
||||||
responseStateAdd.observe(viewLifecycleOwner) {}
|
responseStateAdd.observe(viewLifecycleOwner) {}
|
||||||
response.observe(viewLifecycleOwner) {
|
response.observe(viewLifecycleOwner) {
|
||||||
if (!it.isError) {
|
if (!it.isError) {
|
||||||
ma.messageWithSound(it.response, false, false, "", true)
|
ma.messageWithSound(it.response, isError = false, isPlayed = false, titleWithError = "", isToasted = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
responseUpdateRoute.observe(viewLifecycleOwner) {
|
responseUpdateRoute.observe(viewLifecycleOwner) {
|
||||||
|
@ -276,7 +291,7 @@ class TicketsFragment(
|
||||||
setToolBar()
|
setToolBar()
|
||||||
}
|
}
|
||||||
responseLoadList.observe(viewLifecycleOwner) {
|
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)
|
createLisTickets(mutableListOf(), getSaved = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.model
|
package es.verdnatura.presentation.view.feature.delivery.model
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
||||||
import androidx.room.PrimaryKey
|
import androidx.room.PrimaryKey
|
||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
|
@ -9,9 +7,7 @@ import com.google.gson.annotations.SerializedName
|
||||||
import es.verdnatura.db.MapTypeConverter
|
import es.verdnatura.db.MapTypeConverter
|
||||||
import es.verdnatura.domain.isoToString
|
import es.verdnatura.domain.isoToString
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
class FreeLanceDeliveryInfoList(
|
class FreeLanceDeliveryInfoList(
|
||||||
var list: List<DeliveryInfo> = listOf()
|
var list: List<DeliveryInfo> = listOf()
|
||||||
|
@ -49,7 +45,6 @@ data class ExpeditionInfoLog(
|
||||||
var routeSalix: RouteSalix
|
var routeSalix: RouteSalix
|
||||||
) {
|
) {
|
||||||
var created: String = ""
|
var created: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get() {
|
get() {
|
||||||
return field.isoToString()
|
return field.isoToString()
|
||||||
}
|
}
|
||||||
|
@ -86,7 +81,6 @@ class RouteDelivery(
|
||||||
|
|
||||||
) {
|
) {
|
||||||
var created: String = ""
|
var created: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get(){
|
get(){
|
||||||
return field.isoToString(returnOnlyDate = true)
|
return field.isoToString(returnOnlyDate = true)
|
||||||
}
|
}
|
||||||
|
@ -167,8 +161,8 @@ class RouteInfo(
|
||||||
var numberPlate: String?,
|
var numberPlate: String?,
|
||||||
@SerializedName(value = "name", alternate = ["agencyName"])
|
@SerializedName(value = "name", alternate = ["agencyName"])
|
||||||
var name: String,
|
var name: String,
|
||||||
var kmStart: Long,
|
var kmStart: Long?,
|
||||||
var kmEnd: Long,
|
var kmEnd: Long?,
|
||||||
var started: String,
|
var started: String,
|
||||||
var finished: String,
|
var finished: String,
|
||||||
var header: Boolean = false,
|
var header: Boolean = false,
|
||||||
|
@ -179,5 +173,3 @@ class RouteInfo(
|
||||||
return "$driver$id$name$numberPlate$m3$created$hour$"
|
return "$driver$id$name$numberPlate$m3$created$hour$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
|
|
@ -119,15 +119,10 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
_expeditionInfoLoadUnloadList.value =
|
_expeditionInfoLoadUnloadList.value =
|
||||||
response.body()?.let { ExpeditionList(it) }
|
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
|
expedition: Int
|
||||||
) {
|
) {
|
||||||
salix.getRoutesFromExpedition(
|
salix.getRoutesFromExpedition(
|
||||||
|
@ -180,26 +175,19 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}""".trim()
|
}""".trim()
|
||||||
)
|
).enqueue(object : SalixCallback<List<RouteDelivery>>(context) {
|
||||||
// silex.get_routesFromExpedition(expedition)
|
|
||||||
.enqueue(object : SalixCallback<List<RouteDelivery>>(context) {
|
|
||||||
override fun onSuccess(response: Response<List<RouteDelivery>>) {
|
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)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun expeditionStateAddSalix(expeditions: Any) {
|
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) {
|
salix.addExpeditionState(expeditions).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
override fun onSuccess(response: Response<Unit>) {
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
_responseStateAdd.value = ResponseItemVO("", false, "", 0)
|
_responseStateAdd.value = ResponseItemVO("", false, "", 0)
|
||||||
|
@ -211,7 +199,8 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
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(
|
fun routeGetExpeditionSummary(
|
||||||
route: Int
|
route: Int
|
||||||
) {
|
) {
|
||||||
//Tarea 6275
|
|
||||||
salix.routeGetExpeditionSummary(route)
|
salix.routeGetExpeditionSummary(route)
|
||||||
.enqueue(object : SalixCallback<List<ExpeditionInfoSummary>>(context) {
|
.enqueue(object : SalixCallback<List<ExpeditionInfoSummary>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<ExpeditionInfoSummary>>) {
|
override fun onSuccess(response: Response<List<ExpeditionInfoSummary>>) {
|
||||||
|
|
||||||
if (response.body() != null) {
|
|
||||||
_expeditionInfoSummary.value =
|
_expeditionInfoSummary.value =
|
||||||
response.body()?.let { ExpeditionSummaryList(it) }
|
response.body()?.let { ExpeditionSummaryList(it) }
|
||||||
} else {
|
|
||||||
_expeditionInfoSummary.value = ExpeditionSummaryList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onError(t: Throwable) {
|
|
||||||
_expeditionInfoSummary.value = ExpeditionSummaryList()
|
|
||||||
super.onError(t)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,6 +307,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
arrayListOf(listTickets[0].Id, note).formatWithQuotes()
|
arrayListOf(listTickets[0].Id, note).formatWithQuotes()
|
||||||
).enqueue(object : SalixCallback<Any>(context) {})
|
).enqueue(object : SalixCallback<Any>(context) {})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addNotesFromDropOff(
|
fun addNotesFromDropOff(
|
||||||
ticketObservation: TicketObservation
|
ticketObservation: TicketObservation
|
||||||
|
|
||||||
|
@ -337,16 +316,17 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
ticketObservation
|
ticketObservation
|
||||||
).enqueue(object : SalixCallback<Any>(context) {})
|
).enqueue(object : SalixCallback<Any>(context) {})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateNotesFromDropOff(
|
fun updateNotesFromDropOff(
|
||||||
ticketFK: Long, description: String
|
ticketFK: Long, description: String
|
||||||
|
|
||||||
) {
|
) {
|
||||||
salix.updateNoteFromDropOff(
|
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) {})
|
).enqueue(object : SalixCallback<Any>(context) {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun imageUpload(
|
fun imageUpload(
|
||||||
warehouseId: Number,
|
warehouseId: Number,
|
||||||
companyId: Number,
|
companyId: Number,
|
||||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.diadeventa.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -18,7 +17,7 @@ import es.verdnatura.presentation.view.feature.diadeventa.adapter.DayOfSaleAdapt
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class DayOfSaleFragment(
|
class DayOfSaleFragment(
|
||||||
var entryPoint: String = ""
|
var title: String = ""
|
||||||
) : BaseFragment<FragmentItemdayofsaleCardBinding, DayOfSaleViewModel>(DayOfSaleViewModel::class) {
|
) : BaseFragment<FragmentItemdayofsaleCardBinding, DayOfSaleViewModel>(DayOfSaleViewModel::class) {
|
||||||
|
|
||||||
private lateinit var customDialogList: CustomDialogList
|
private lateinit var customDialogList: CustomDialogList
|
||||||
|
@ -28,7 +27,7 @@ class DayOfSaleFragment(
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(entryPoint: String) = DayOfSaleFragment(entryPoint)
|
fun newInstance(title: String) = DayOfSaleFragment(title)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
|
@ -43,7 +42,7 @@ class DayOfSaleFragment(
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
setEvents()
|
setEvents()
|
||||||
setToolBar(entryPoint)
|
setToolBar(title)
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,11 +52,7 @@ class DayOfSaleFragment(
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||||
val iconParking = ImageView(context)
|
val iconParking = ImageView(context)
|
||||||
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
|
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)
|
listIcons.add(iconParking)
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
@ -79,10 +74,14 @@ class DayOfSaleFragment(
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
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())
|
viewModel.itemShelvingGetSaleDate(binding.scanInput.text.toString())
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
entryPoint + ":" + binding.scanInput.text.toString().uppercase()
|
getString(
|
||||||
|
R.string.doubleText,
|
||||||
|
title,
|
||||||
|
binding.scanInput.text.toString().uppercase()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
ma.hideKeyboard(binding.scanInput)
|
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(),
|
parking = customDialogList.getValue(),
|
||||||
scanItem = itemScan
|
scanItem = itemScan
|
||||||
)
|
)
|
||||||
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
}
|
}
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
|
|
|
@ -3,74 +3,30 @@ package es.verdnatura.presentation.view.feature.diadeventa.fragment
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.map
|
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.Event
|
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
||||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDateList
|
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDateList
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
|
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>() }
|
private val _itemShelvingSaleDateList by lazy { MutableLiveData<ItemShelvingSaleDateList>() }
|
||||||
val itemShelvingSaleDateList: LiveData<ItemShelvingSaleDateList>
|
val itemShelvingSaleDateList: LiveData<ItemShelvingSaleDateList>
|
||||||
get() = _itemShelvingSaleDateList
|
get() = _itemShelvingSaleDateList
|
||||||
|
|
||||||
val loadItemShelvingSaleDateList: LiveData<Event<ItemShelvingSaleDateList>> = _itemShelvingSaleDateList.map { Event(it) }
|
|
||||||
|
|
||||||
fun itemShelvingGetSaleDate(vShelvingFK: String) {
|
fun itemShelvingGetSaleDate(vShelvingFK: String) {
|
||||||
//salix falla fecha
|
|
||||||
// silex.itemShelving_getSaleDate(vShelvingFK)
|
|
||||||
salix.itemShelvingGetSaleDate(params = listOf(vShelvingFK).formatWithQuotes())
|
salix.itemShelvingGetSaleDate(params = listOf(vShelvingFK).formatWithQuotes())
|
||||||
.enqueue(object :
|
.enqueue(object : SalixCallback<List<ItemShelvingSaleDate>>(context) {
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<ItemShelvingSaleDate>>) {
|
override fun onSuccess(response: Response<List<ItemShelvingSaleDate>>) {
|
||||||
|
|
||||||
if (response.body() != null) {
|
|
||||||
|
|
||||||
_itemShelvingSaleDateList.value = response.body()?.let {
|
_itemShelvingSaleDateList.value = response.body()?.let {
|
||||||
ItemShelvingSaleDateList(it)
|
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -78,9 +34,7 @@ class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
fun setParking(scanItem: String, parking: String) {
|
fun setParking(scanItem: String, parking: String) {
|
||||||
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
|
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
|
||||||
.enqueue(object :
|
.enqueue(object : SalixCallback<Any>(context) {})
|
||||||
SalixCallback<Any>(context) {
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,15 @@
|
||||||
package es.verdnatura.presentation.view.feature.diadeventa.model
|
package es.verdnatura.presentation.view.feature.diadeventa.model
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import es.verdnatura.domain.isoToString
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemShelvingSaleDate(
|
class ItemShelvingSaleDate(
|
||||||
var itemFk: Int? = null,
|
var itemFk: Int? = null,
|
||||||
var longName: String? = null,
|
var longName: String? = null,
|
||||||
// var dated:String? = null,
|
|
||||||
var amount: Int? = null,
|
var amount: Int? = null,
|
||||||
var visible: Int? = null,
|
var visible: Int? = null,
|
||||||
var stock: Int? = null,
|
var stock: Int? = null,
|
||||||
var isError:Boolean = false,
|
|
||||||
var errorMessage:String = ""
|
|
||||||
) {
|
) {
|
||||||
var dated: String = ""
|
var dated: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get() {
|
get() {
|
||||||
return field.isoToString(returnOnlyDate = true)
|
return field.isoToString(returnOnlyDate = true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHisto
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class HistoricoArticuloFragment(
|
class HistoricoArticuloFragment(
|
||||||
|
@ -249,7 +250,7 @@ class HistoricoArticuloFragment(
|
||||||
|
|
||||||
private fun navigateToToday(it: ItemHistoricoListVO) {
|
private fun navigateToToday(it: ItemHistoricoListVO) {
|
||||||
var positionToday = 0
|
var positionToday = 0
|
||||||
val sdf = SimpleDateFormat(getString(R.string.dateFormat))
|
val sdf = SimpleDateFormat(getString(R.string.dateFormat), Locale.getDefault())
|
||||||
val currentDate = sdf.format(Date())
|
val currentDate = sdf.format(Date())
|
||||||
|
|
||||||
for (item in it.list) {
|
for (item in it.list) {
|
||||||
|
|
|
@ -16,8 +16,6 @@ class ItemHistoricoVO(
|
||||||
var balance: Int? = null,
|
var balance: Int? = null,
|
||||||
var isTicket: Int? = 0,
|
var isTicket: Int? = 0,
|
||||||
var order: Int? = 0,
|
var order: Int? = 0,
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = ""
|
|
||||||
) {
|
) {
|
||||||
var shipped: String = ""
|
var shipped: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package es.verdnatura.presentation.view.feature.historicoshelving.model
|
package es.verdnatura.presentation.view.feature.historicoshelving.model
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import es.verdnatura.domain.isoToString
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemShelvingLog(
|
class ItemShelvingLog(
|
||||||
|
@ -10,14 +8,9 @@ class ItemShelvingLog(
|
||||||
var shelvingFk: String? = null,
|
var shelvingFk: String? = null,
|
||||||
var visible: Int? = null,
|
var visible: Int? = null,
|
||||||
var accion: String? = null,
|
var accion: String? = null,
|
||||||
//var created:String? = null,
|
|
||||||
var code: String? = null,
|
var code: String? = null,
|
||||||
var isError:Boolean = false,
|
|
||||||
var errorMessage:String = ""
|
|
||||||
) {
|
) {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
var created: String = ""
|
var created: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get() {
|
get() {
|
||||||
return field.isoToString(returnOnlyDate = false)
|
return field.isoToString(returnOnlyDate = false)
|
||||||
}
|
}
|
||||||
|
@ -25,7 +18,8 @@ class ItemShelvingLog(
|
||||||
}
|
}
|
||||||
|
|
||||||
class ItemShelvingSaleDateList(
|
class ItemShelvingSaleDateList(
|
||||||
var list:List<ItemShelvingLog> = listOf())
|
var list: List<ItemShelvingLog> = listOf()
|
||||||
|
)
|
||||||
|
|
||||||
class ItemShelvingLogList(
|
class ItemShelvingLogList(
|
||||||
var list: List<ItemShelvingLog> = listOf()
|
var list: List<ItemShelvingLog> = listOf()
|
||||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -50,7 +49,7 @@ class ShelvingLogFragment(
|
||||||
binding.scanInput.requestFocus()
|
binding.scanInput.requestFocus()
|
||||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
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()))
|
viewModel.shelvings((binding.scanInput.text.toString()))
|
||||||
itemScan = binding.scanInput.text.toString()
|
itemScan = binding.scanInput.text.toString()
|
||||||
}
|
}
|
||||||
|
@ -70,7 +69,7 @@ class ShelvingLogFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
|
||||||
loadShelvingLogSalixList.observe(viewLifecycleOwner, Observer { event ->
|
loadShelvingLogSalixList.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
binding.itemshelvinglogRecyclerview.adapter = adapter
|
binding.itemshelvinglogRecyclerview.adapter = adapter
|
||||||
binding.itemshelvinglogRecyclerview.layoutManager =
|
binding.itemshelvinglogRecyclerview.layoutManager =
|
||||||
|
@ -98,7 +97,7 @@ class ShelvingLogFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,7 @@ class ShelvingLogSalix(
|
||||||
var isPrinted: Boolean? = null,
|
var isPrinted: Boolean? = null,
|
||||||
var priority: Int? = null,
|
var priority: Int? = null,
|
||||||
var userFk: Int? = null,
|
var userFk: Int? = null,
|
||||||
var isRecyclable: Boolean? = null,
|
var isRecyclable: Boolean? = null
|
||||||
var isError: Boolean? = null,
|
|
||||||
var errorMessage: String? = null,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class DeviceLogSalix(
|
data class DeviceLogSalix(
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
|
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentHistoricovehiculoBinding
|
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 es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
class HistoricoVehiculoFragment(
|
class HistoricoVehiculoFragment(
|
||||||
private var numberPlate: String = ""
|
private var numberPlate: String = ""
|
||||||
|
@ -45,15 +42,17 @@ class HistoricoVehiculoFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadHistoricoVehiculoList.observe(viewLifecycleOwner, Observer { event ->
|
loadHistoricoVehiculoList.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
|
|
||||||
if (it.list.isEmpty()) {
|
if (it.list.isEmpty()) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.lookWithpermission), isError = true, isPlayed = true, getString(
|
getString(R.string.lookWithpermission),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
getString(
|
||||||
R.string.info
|
R.string.info
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -61,19 +60,23 @@ class HistoricoVehiculoFragment(
|
||||||
adapter = HistoricoVehiculoAdapter(it.list)
|
adapter = HistoricoVehiculoAdapter(it.list)
|
||||||
binding.historicovehiculoRecyclerview.adapter = adapter
|
binding.historicovehiculoRecyclerview.adapter = adapter
|
||||||
binding.historicovehiculoRecyclerview.layoutManager =
|
binding.historicovehiculoRecyclerview.layoutManager =
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(
|
||||||
|
requireContext(),
|
||||||
|
LinearLayoutManager.VERTICAL,
|
||||||
|
false
|
||||||
|
)
|
||||||
navigateToToday(it)
|
navigateToToday(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun navigateToToday(it: ItemHistoricoVehiculoList) {
|
private fun navigateToToday(it: ItemHistoricoVehiculoList) {
|
||||||
var positionToday = 0
|
var positionToday = 0
|
||||||
val sdf = SimpleDateFormat(getString(R.string.dateFormat))
|
val sdf = SimpleDateFormat(getString(R.string.dateFormat), Locale.getDefault())
|
||||||
val currentDate = sdf.format(Date())
|
val currentDate = sdf.format(Date())
|
||||||
|
|
||||||
for (item in it.list) {
|
for (item in it.list) {
|
||||||
|
|
|
@ -18,8 +18,6 @@ class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context)
|
||||||
val loadHistoricoVehiculoList: LiveData<Event<ItemHistoricoVehiculoList>> = _historicovehiculoList.map { Event(it) }
|
val loadHistoricoVehiculoList: LiveData<Event<ItemHistoricoVehiculoList>> = _historicovehiculoList.map { Event(it) }
|
||||||
|
|
||||||
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
|
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
|
||||||
//salix falla fecha
|
|
||||||
//silex.machineWorker_getHistorical(plateNumber,workerId)
|
|
||||||
salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
|
salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SalixCallback<List<ItemHistoricoVehiculo>>(context) {
|
SalixCallback<List<ItemHistoricoVehiculo>>(context) {
|
||||||
|
|
|
@ -1,23 +1,16 @@
|
||||||
package es.verdnatura.presentation.view.feature.historicovehiculo.model
|
package es.verdnatura.presentation.view.feature.historicovehiculo.model
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import es.verdnatura.domain.isoToString
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemHistoricoVehiculo(
|
class ItemHistoricoVehiculo(
|
||||||
//var inTimed: String? = null,
|
|
||||||
var workerName: String? = null,
|
var workerName: String? = null,
|
||||||
//var outTimed: String? = null,
|
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = ""
|
|
||||||
) {
|
) {
|
||||||
var inTimed: String = ""
|
var inTimed: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get() {
|
get() {
|
||||||
return field.isoToString()
|
return field.isoToString()
|
||||||
}
|
}
|
||||||
var outTimed: String = ""
|
var outTimed: String = ""
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
get() {
|
get() {
|
||||||
return field.isoToString()
|
return field.isoToString()
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,11 +82,8 @@ class InventoryParkingAdapter(
|
||||||
fun bind(item: ItemInventoryParking) {
|
fun bind(item: ItemInventoryParking) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
this.item = item
|
this.item = item
|
||||||
//Quitar if cuadndo se suba a producción https://redmine.verdnatura.es/issues/6193
|
|
||||||
imgItem.loadUrl(
|
imgItem.loadUrl(
|
||||||
if (item.urlImage.isNullOrBlank()) { "http://${item.url}/catalog/1600x900/$item.image"} else {
|
"http://${item.url}/catalog/1600x900/${item.image}"
|
||||||
item.urlImage
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
imgItem.setOnClickListener {
|
imgItem.setOnClickListener {
|
||||||
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
onPasillerosItemClickListener.onPasillerosItemClickListener(
|
||||||
|
|
|
@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.inventario.fragment
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.lifecycle.lifecycleScope
|
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.inventario.model.ItemInventaryVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
|
import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat
|
||||||
import ir.mirrajabi.searchdialog.core.SearchResultListener
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
|
@ -35,8 +33,8 @@ class InventaryFragment :
|
||||||
|
|
||||||
private var adapter: InventoryAdapter? = null
|
private var adapter: InventoryAdapter? = null
|
||||||
private lateinit var customDialogInput: CustomDialogInput
|
private lateinit var customDialogInput: CustomDialogInput
|
||||||
private var listInvetory: ArrayList<ItemInventaryVO> = ArrayList()
|
private var listInventory: ArrayList<ItemInventaryVO> = ArrayList()
|
||||||
private var listInvetoryAux: ArrayList<ItemInventaryVO> = ArrayList()
|
private var listInventoryAux: ArrayList<ItemInventaryVO> = ArrayList()
|
||||||
private lateinit var customDialog: CustomDialogTwoButtons
|
private lateinit var customDialog: CustomDialogTwoButtons
|
||||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||||
private var layoutManager: LinearLayoutManager? = null
|
private var layoutManager: LinearLayoutManager? = null
|
||||||
|
@ -69,12 +67,13 @@ class InventaryFragment :
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
binding.filterBuyer.setOnClickListener {
|
binding.filterBuyer.setOnClickListener {
|
||||||
SimpleSearchDialogCompat(context,
|
SimpleSearchDialogCompat(
|
||||||
|
context,
|
||||||
getString(R.string.compradores),
|
getString(R.string.compradores),
|
||||||
getString(R.string.escribirparteNombre),
|
getString(R.string.escribirparteNombre),
|
||||||
null,
|
null,
|
||||||
items,
|
items
|
||||||
SearchResultListener { baseSearchDialogCompat, nombre, position ->
|
) { baseSearchDialogCompat, nombre, position ->
|
||||||
|
|
||||||
binding.filterBuyer.text = (nombre.title)
|
binding.filterBuyer.text = (nombre.title)
|
||||||
buyerId = nombre.getBuyerId()
|
buyerId = nombre.getBuyerId()
|
||||||
|
@ -89,13 +88,12 @@ class InventaryFragment :
|
||||||
nombre.getBuyerId()
|
nombre.getBuyerId()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// saveBuyer(nombre.getBuyerNickname(), nombre.getBuyerId())
|
|
||||||
viewModel.getInventory(
|
viewModel.getInventory(
|
||||||
nombre.getBuyerId().toInt(),
|
nombre.getBuyerId().toInt(),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
||||||
)
|
)
|
||||||
baseSearchDialogCompat.dismiss()
|
baseSearchDialogCompat.dismiss()
|
||||||
}).show()
|
}.show()
|
||||||
}
|
}
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
customDialog = CustomDialogTwoButtons(requireContext())
|
customDialog = CustomDialogTwoButtons(requireContext())
|
||||||
|
@ -111,9 +109,7 @@ class InventaryFragment :
|
||||||
val iconReload = ImageView(context)
|
val iconReload = ImageView(context)
|
||||||
|
|
||||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
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)
|
listIcons.add(iconReload)
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||||
|
@ -153,17 +149,17 @@ class InventaryFragment :
|
||||||
binding.filterItemFk.setOnKeyListener { v, keyCode, event ->
|
binding.filterItemFk.setOnKeyListener { v, keyCode, event ->
|
||||||
if (binding.filterItemFk.text.toString().isEmpty()) {
|
if (binding.filterItemFk.text.toString().isEmpty()) {
|
||||||
|
|
||||||
if (listInvetory.size != listInvetoryAux.size) {
|
if (listInventory.size != listInventoryAux.size) {
|
||||||
listInvetory.removeAll(listInvetoryAux)
|
listInventory.removeAll(listInventoryAux.toSet())
|
||||||
listInvetory.addAll(listInvetoryAux)
|
listInventory.addAll(listInventoryAux)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
listInvetory.removeAll(listInvetoryAux)
|
listInventory.removeAll(listInventoryAux.toSet())
|
||||||
|
|
||||||
listInvetory.addAll(listInvetoryAux.filter {
|
listInventory.addAll(listInventoryAux.filter {
|
||||||
it.itemFk!!.toString().contains(
|
it.itemFk!!.toString().contains(
|
||||||
binding.filterItemFk.text.toString(), true
|
binding.filterItemFk.text.toString(), true
|
||||||
) || it.producer?.contains(
|
) || it.producer?.contains(
|
||||||
|
@ -187,7 +183,7 @@ class InventaryFragment :
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
if (binding.locationRecyclerview.layoutManager != null) {
|
if (binding.locationRecyclerview.layoutManager != null) {
|
||||||
if (firstVisiblePosition <= listInvetory.size) {
|
if (firstVisiblePosition <= listInventory.size) {
|
||||||
binding.locationRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
|
binding.locationRecyclerview.layoutManager!!.scrollToPosition(firstVisiblePosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,32 +196,25 @@ class InventaryFragment :
|
||||||
}
|
}
|
||||||
|
|
||||||
inventaryList.observe(viewLifecycleOwner) { it ->
|
inventaryList.observe(viewLifecycleOwner) { it ->
|
||||||
listInvetory = ArrayList()
|
listInventory = ArrayList()
|
||||||
listInvetoryAux = ArrayList()
|
listInventoryAux = ArrayList()
|
||||||
it.list.forEach {
|
it.list.forEach {
|
||||||
if (it.nicho != 0) {
|
if (it.nicho != 0) {
|
||||||
listInvetory.add(it)
|
listInventory.add(it)
|
||||||
listInvetoryAux.add(it)
|
listInventoryAux.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adapter = InventoryAdapter(listInvetory, object : OnInvetoryNichoClickListener {
|
adapter = InventoryAdapter(listInventory, object : OnInvetoryNichoClickListener {
|
||||||
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
|
override fun onInvetoryNichoClickListener(item: ItemInventaryVO) {
|
||||||
customDialog.setTitle(item.itemFk.toString() + "\n" + item.longName)
|
customDialog.setTitle(item.itemFk.toString() + "\n" + item.longName)
|
||||||
.setDescription(getString(R.string.quantityReal) + item.nicho + ")")
|
.setDescription(getString(R.string.quantityReal) + item.nicho + ")")
|
||||||
.setOkButton(getString(R.string.pull)) {
|
.setOkButton(getString(R.string.pull)) {
|
||||||
viewModel.itemTrash(
|
|
||||||
item.itemFk!!.toInt(),
|
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
|
|
||||||
item.nicho!!,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
//Tarea 7161
|
//Tarea 7161
|
||||||
/* viewModel.itemSetVisibleDiscard(
|
viewModel.itemSetVisibleDiscard(
|
||||||
item.itemFk!!.toInt(),
|
item.itemFk!!.toInt(),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
|
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
|
||||||
item.nicho!!,
|
item.nicho!!
|
||||||
false
|
)
|
||||||
)*/
|
|
||||||
itemClicked = item
|
itemClicked = item
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.setOkButtonTwo(getString(R.string.titleUbicator)) {
|
}.setOkButtonTwo(getString(R.string.titleUbicator)) {
|
||||||
|
@ -247,7 +236,7 @@ class InventaryFragment :
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
binding.locationRecyclerview.layoutManager = layoutManager
|
binding.locationRecyclerview.layoutManager = layoutManager
|
||||||
|
|
||||||
if (firstVisiblePosition <= listInvetory.size) {
|
if (firstVisiblePosition <= listInventory.size) {
|
||||||
binding.locationRecyclerview.layoutManager!!.scrollToPosition(
|
binding.locationRecyclerview.layoutManager!!.scrollToPosition(
|
||||||
firstVisiblePosition
|
firstVisiblePosition
|
||||||
)
|
)
|
||||||
|
@ -261,15 +250,15 @@ class InventaryFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
|
||||||
private fun changeOfflineValue(item: ItemInventaryVO) {
|
private fun changeOfflineValue(item: ItemInventaryVO) {
|
||||||
try {
|
try {
|
||||||
listInvetory.removeAt(listInvetory.indexOf(item))
|
listInventory.removeAt(listInventory.indexOf(item))
|
||||||
listInvetoryAux.removeAt(listInvetoryAux.indexOf(item))
|
listInventoryAux.removeAt(listInventoryAux.indexOf(item))
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ex.message!!.toast(requireContext())
|
ex.message!!.toast(requireContext())
|
||||||
}
|
}
|
||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyItemRemoved(listInventory.indexOf(item))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createBuyerList(list: List<BuyerVO>) {
|
private fun createBuyerList(list: List<BuyerVO>) {
|
||||||
|
|
|
@ -3,15 +3,13 @@ package es.verdnatura.presentation.view.feature.inventario.fragment
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.appcompat.content.res.AppCompatResources
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.gson.JsonArray
|
import com.google.gson.JsonArray
|
||||||
|
@ -21,8 +19,15 @@ import es.verdnatura.databinding.FragmentInventoryParkingBinding
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.*
|
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||||
import es.verdnatura.presentation.view.component.*
|
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.adapter.BarcodeAdapter
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.inventario.adapter.InventoryParkingAdapter
|
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.ItemShelvingVisible
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisibleZero
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemShelvingVisibleZero
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
|
import timber.log.Timber.d
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class InventaryParkingFragment(
|
class InventaryParkingFragment(
|
||||||
|
@ -67,7 +73,7 @@ class InventaryParkingFragment(
|
||||||
binding.inventoryParkingRecyclerview.layoutManager as LinearLayoutManager
|
binding.inventoryParkingRecyclerview.layoutManager as LinearLayoutManager
|
||||||
scrollPosition = layoutManager.findFirstVisibleItemPosition()
|
scrollPosition = layoutManager.findFirstVisibleItemPosition()
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
d(exception)
|
||||||
}
|
}
|
||||||
|
|
||||||
isBack = true
|
isBack = true
|
||||||
|
@ -80,7 +86,6 @@ class InventaryParkingFragment(
|
||||||
super.onAttach(context)
|
super.onAttach(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
|
||||||
customDialogInput = CustomDialogInput(requireContext())
|
customDialogInput = CustomDialogInput(requireContext())
|
||||||
|
@ -108,7 +113,6 @@ class InventaryParkingFragment(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
|
|
||||||
val iconAdd = ImageView(context)
|
val iconAdd = ImageView(context)
|
||||||
|
@ -126,15 +130,12 @@ class InventaryParkingFragment(
|
||||||
val iconParkingFrom = ImageView(context)
|
val iconParkingFrom = ImageView(context)
|
||||||
iconParkingFrom.setImageResource(R.drawable.ic_eye_inventory)
|
iconParkingFrom.setImageResource(R.drawable.ic_eye_inventory)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
iconParkingFrom.tooltipText = getTooltip(R.drawable.ic_eye_inventory)
|
iconParkingFrom.tooltipText = getTooltip(R.drawable.ic_eye_inventory)
|
||||||
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
iconReload.tooltipText = getTooltip(R.drawable.ic_autorenew_black_24dp)
|
||||||
iconAdd.tooltipText = getString(R.string.addItemShelving)
|
iconAdd.tooltipText = getString(R.string.addItemShelving)
|
||||||
iconReset.tooltipText = getTooltip(R.drawable.ic_remove_checks)
|
iconReset.tooltipText = getTooltip(R.drawable.ic_remove_checks)
|
||||||
iconFilter.tooltipText = getTooltip(R.drawable.ic_filter_inventory)
|
iconFilter.tooltipText = getTooltip(R.drawable.ic_filter_inventory)
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listIcons.isEmpty()) {
|
if (listIcons.isEmpty()) {
|
||||||
listIcons.add(iconParkingFrom)
|
listIcons.add(iconParkingFrom)
|
||||||
listIcons.add(iconFilter)
|
listIcons.add(iconFilter)
|
||||||
|
@ -168,12 +169,13 @@ class InventaryParkingFragment(
|
||||||
)
|
)
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
d(ex)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iconReset.drawable -> {
|
iconReset.drawable -> {
|
||||||
if (!myListInventory.isNullOrEmpty()) {
|
if (myListInventory.isNotEmpty()) {
|
||||||
binding.textinputlayoutMatricula.visibility = VISIBLE
|
binding.textinputlayoutMatricula.visibility = VISIBLE
|
||||||
showResetShelving()
|
showResetShelving()
|
||||||
} else {
|
} else {
|
||||||
|
@ -205,7 +207,8 @@ class InventaryParkingFragment(
|
||||||
(binding.mainToolbar.toolbarIcons.adapter as ToolBarAdapterTooltip).setItemsList(
|
(binding.mainToolbar.toolbarIcons.adapter as ToolBarAdapterTooltip).setItemsList(
|
||||||
filterList.filter {
|
filterList.filter {
|
||||||
it.drawable.constantState?.equals(
|
it.drawable.constantState?.equals(
|
||||||
context?.getDrawable(
|
AppCompatResources.getDrawable(
|
||||||
|
requireContext(),
|
||||||
R.drawable.ic_remove_checks
|
R.drawable.ic_remove_checks
|
||||||
)?.constantState
|
)?.constantState
|
||||||
) != true
|
) != true
|
||||||
|
@ -247,7 +250,13 @@ class InventaryParkingFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inqValues.size() == 0) {
|
if (inqValues.size() == 0) {
|
||||||
ma.messageWithSound("", true, true, "", null)
|
ma.messageWithSound(
|
||||||
|
"",
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
titleWithError = "",
|
||||||
|
isToasted = null
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
filter.add("id", JsonObject().apply { add("inq", inqValues) })
|
filter.add("id", JsonObject().apply { add("inq", inqValues) })
|
||||||
viewModel.itemShelvingsReset(
|
viewModel.itemShelvingsReset(
|
||||||
|
@ -295,7 +304,13 @@ class InventaryParkingFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} 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)
|
listWagonsAdapter!!.notifyItemInserted(listParkings.size - 1)
|
||||||
|
@ -327,15 +342,20 @@ class InventaryParkingFragment(
|
||||||
viewModel.getInventoryParking(
|
viewModel.getInventoryParking(
|
||||||
parkingFromScan, parkingToScan
|
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")
|
@SuppressLint("SetTextI18n")
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
isBack = true
|
isBack = true
|
||||||
if (shelvingSaved.isNullOrBlank()) {
|
if (shelvingSaved.isBlank()) {
|
||||||
ma.onMyBackPressed()
|
ma.onMyBackPressed()
|
||||||
} else {
|
} else {
|
||||||
resetChecking()
|
resetChecking()
|
||||||
|
@ -355,7 +375,8 @@ class InventaryParkingFragment(
|
||||||
binding.editMatricula.hint = getString(R.string.scanShelving)
|
binding.editMatricula.hint = getString(R.string.scanShelving)
|
||||||
chageListAdapter(listIcons.filter {
|
chageListAdapter(listIcons.filter {
|
||||||
it.drawable.constantState?.equals(
|
it.drawable.constantState?.equals(
|
||||||
context?.getDrawable(
|
AppCompatResources.getDrawable(
|
||||||
|
requireContext(),
|
||||||
R.drawable.ic_remove_checks
|
R.drawable.ic_remove_checks
|
||||||
)?.constantState
|
)?.constantState
|
||||||
) != true
|
) != true
|
||||||
|
@ -368,7 +389,7 @@ class InventaryParkingFragment(
|
||||||
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
|
binding.editMatricula.setOnEditorActionListener { v, actionId, event ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
|
|
||||||
if (!binding.editMatricula.text.toString().isEmpty()) {
|
if (binding.editMatricula.text.toString().isNotEmpty()) {
|
||||||
|
|
||||||
if (positionShelvingChecking == -1) {
|
if (positionShelvingChecking == -1) {
|
||||||
|
|
||||||
|
@ -387,10 +408,11 @@ class InventaryParkingFragment(
|
||||||
item.shelvingFk.uppercase() == binding.editMatricula.text.toString()
|
item.shelvingFk.uppercase() == binding.editMatricula.text.toString()
|
||||||
}
|
}
|
||||||
if (positionShelvingChecking != -1) {
|
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() }
|
myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() }
|
||||||
.all { item ->
|
.all { item ->
|
||||||
item.isChecked != null && item.isChecked!! > 0
|
item.isChecked != null && item.isChecked!! > 0
|
||||||
|
@ -401,7 +423,11 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
if (allChecked) {
|
if (allChecked) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.plateChecked), false, true, "", isToasted = true
|
getString(R.string.plateChecked),
|
||||||
|
isError = false,
|
||||||
|
isPlayed = true,
|
||||||
|
titleWithError = "",
|
||||||
|
isToasted = true
|
||||||
)
|
)
|
||||||
chageListAdapter(listIcons)
|
chageListAdapter(listIcons)
|
||||||
adapter!!.setItems(myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() })
|
adapter!!.setItems(myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() })
|
||||||
|
@ -415,7 +441,11 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
if (positionShelvingChecking == -1) {
|
if (positionShelvingChecking == -1) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.shelvingNotFound), true, true, "", true
|
getString(R.string.shelvingNotFound),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
titleWithError = "",
|
||||||
|
isToasted = true
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -439,7 +469,13 @@ class InventaryParkingFragment(
|
||||||
)
|
)
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} 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) {
|
if (positionItemChecking == -1) {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.itemNotFoundScanAgain), true, true, "", true
|
getString(R.string.itemNotFoundScanAgain),
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
titleWithError = "",
|
||||||
|
isToasted = true
|
||||||
)
|
)
|
||||||
|
|
||||||
positionShelvingChecking = -1
|
positionShelvingChecking = -1
|
||||||
|
@ -484,10 +524,10 @@ class InventaryParkingFragment(
|
||||||
ItemShelvingChecked(true, mobileApplication.userId!!)
|
ItemShelvingChecked(true, mobileApplication.userId!!)
|
||||||
)
|
)
|
||||||
myListInventory[positionItemChecking].isChecked = 1
|
myListInventory[positionItemChecking].isChecked = 1
|
||||||
adapter!!.notifyDataSetChanged()
|
adapter!!.notifyItemChanged(positionItemChecking)
|
||||||
binding.editMatricula.hint = getString(R.string.scanShelving)
|
binding.editMatricula.hint = getString(R.string.scanShelving)
|
||||||
|
|
||||||
var allChecked =
|
val allChecked =
|
||||||
myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() }
|
myListInventory.filter { it.shelvingFk.uppercase() == myListInventory[positionShelvingChecking].shelvingFk.uppercase() }
|
||||||
.all { item ->
|
.all { item ->
|
||||||
item.isChecked != null && item.isChecked!! > 0
|
item.isChecked != null && item.isChecked!! > 0
|
||||||
|
@ -499,7 +539,7 @@ class InventaryParkingFragment(
|
||||||
positionShelvingChecking = -1
|
positionShelvingChecking = -1
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
d(ex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -509,15 +549,9 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
|
|
||||||
inventoryListParking.observe(viewLifecycleOwner, Observer {
|
inventoryListParking.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
if (it.list.isNotEmpty()) {
|
if (it.list.isNotEmpty()) {
|
||||||
if (it.list[0].isError) {
|
|
||||||
ma.messageWithSound(
|
|
||||||
it.list[0].errorMessage, it.list[0].isError, false
|
|
||||||
)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
myListInventory = it.list as MutableList<ItemInventoryParking>
|
myListInventory = it.list as MutableList<ItemInventoryParking>
|
||||||
createListInventoryParking()
|
createListInventoryParking()
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
|
@ -526,27 +560,26 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
loadReponseCode.observe(viewLifecycleOwner) { event ->
|
loadReponseCode.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
checkItem(it.response)
|
checkItem(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response.observe(viewLifecycleOwner, Observer {
|
response.observe(viewLifecycleOwner) {
|
||||||
chageListAdapter(listIcons, true)
|
chageListAdapter(listIcons, true)
|
||||||
callGetInventory(
|
callGetInventory(
|
||||||
parkingFrom, parkingTo
|
parkingFrom, parkingTo
|
||||||
)
|
)
|
||||||
|
|
||||||
})
|
}
|
||||||
responseReset.observe(viewLifecycleOwner, Observer {
|
responseReset.observe(viewLifecycleOwner) {
|
||||||
callGetInventory(
|
callGetInventory(
|
||||||
parkingFrom, parkingTo
|
parkingFrom, parkingTo
|
||||||
)
|
)
|
||||||
chageListAdapter(listIcons, true)
|
chageListAdapter(listIcons, true)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -555,14 +588,14 @@ class InventaryParkingFragment(
|
||||||
) {
|
) {
|
||||||
|
|
||||||
adapter = InventoryParkingAdapter((if (filterActivated) {
|
adapter = InventoryParkingAdapter((if (filterActivated) {
|
||||||
if (!shelvingSaved.isNullOrEmpty()) {
|
if (shelvingSaved.isNotEmpty()) {
|
||||||
myListInventory.filter { (it.isChecked == null || it.isChecked == 0) && it.shelvingFk.uppercase() == shelvingSaved.uppercase() }
|
myListInventory.filter { (it.isChecked == null || it.isChecked == 0) && it.shelvingFk.uppercase() == shelvingSaved.uppercase() }
|
||||||
} else {
|
} else {
|
||||||
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
|
myListInventory.filter { it.isChecked == null || it.isChecked == 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!shelvingSaved.isNullOrEmpty()) {
|
if (shelvingSaved.isNotEmpty()) {
|
||||||
myListInventory.filter { it.shelvingFk.uppercase() == shelvingSaved.uppercase() }
|
myListInventory.filter { it.shelvingFk.uppercase() == shelvingSaved.uppercase() }
|
||||||
} else {
|
} else {
|
||||||
myListInventory
|
myListInventory
|
||||||
|
@ -593,7 +626,8 @@ class InventaryParkingFragment(
|
||||||
|
|
||||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||||
customDialogInput.setTitle(getString(R.string.quantity))
|
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)) {
|
.setOkButton(getString(R.string.modify)) {
|
||||||
try {
|
try {
|
||||||
if (customDialogInput.getValue().toInt() >= 0) {
|
if (customDialogInput.getValue().toInt() >= 0) {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import androidx.lifecycle.map
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import es.verdnatura.MobileApplication
|
import es.verdnatura.MobileApplication
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
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.ItemInventaryVO
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
|
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.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.ExpeditionMistakeSalix
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
||||||
|
import 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.WorkerMistakeSalix
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.departmentMistakeList
|
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeTypeList
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.workerFromMistakeList
|
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.workerMistakeTypeList
|
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
@ -36,28 +35,28 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val inventaryList: LiveData<InventaryListVO>
|
val inventaryList: LiveData<InventaryListVO>
|
||||||
get() = _inventaryList
|
get() = _inventaryList
|
||||||
|
|
||||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _response by lazy { MutableLiveData<Any>() }
|
||||||
val response: LiveData<ResponseItemVO>
|
val response: LiveData<Any>
|
||||||
get() = _response
|
get() = _response
|
||||||
|
|
||||||
private val _responseReset by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseReset by lazy { MutableLiveData<String>() }
|
||||||
val responseReset: LiveData<ResponseItemVO>
|
val responseReset: LiveData<String>
|
||||||
get() = _responseReset
|
get() = _responseReset
|
||||||
|
|
||||||
private val _buyersList by lazy { MutableLiveData<BuyerListVO>() }
|
private val _buyersList by lazy { MutableLiveData<BuyerListVO>() }
|
||||||
val buyersList: LiveData<BuyerListVO>
|
val buyersList: LiveData<BuyerListVO>
|
||||||
get() = _buyersList
|
get() = _buyersList
|
||||||
|
|
||||||
private val _mistakeDepartmentList by lazy { MutableLiveData<departmentMistakeList>() }
|
private val _mistakeDepartmentList by lazy { MutableLiveData<DepartmentMistakeList>() }
|
||||||
val mistakeDepartmentList: LiveData<departmentMistakeList>
|
val mistakeDepartmentList: LiveData<DepartmentMistakeList>
|
||||||
get() = _mistakeDepartmentList
|
get() = _mistakeDepartmentList
|
||||||
|
|
||||||
private val _workerFromMistakeList by lazy { MutableLiveData<workerFromMistakeList>() }
|
private val _workerFromMistakeList by lazy { MutableLiveData<WorkerFromMistakeList>() }
|
||||||
val workerFromMistakeList: LiveData<workerFromMistakeList>
|
val workerFromMistakeList: LiveData<WorkerFromMistakeList>
|
||||||
get() = _workerFromMistakeList
|
get() = _workerFromMistakeList
|
||||||
|
|
||||||
private val _mistakeWorkerList by lazy { MutableLiveData<workerMistakeTypeList>() }
|
private val _mistakeWorkerList by lazy { MutableLiveData<WorkerMistakeTypeList>() }
|
||||||
val mistakeWorkerList: LiveData<workerMistakeTypeList>
|
val mistakeWorkerList: LiveData<WorkerMistakeTypeList>
|
||||||
get() = _mistakeWorkerList
|
get() = _mistakeWorkerList
|
||||||
|
|
||||||
private val _responseAddMistake by lazy { MutableLiveData<ResponseItemVO>() }
|
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>() }
|
private val _inventoryListParking by lazy { MutableLiveData<InventoryParkingList>() }
|
||||||
val inventoryListParking: LiveData<InventoryParkingList>
|
val inventoryListParking: LiveData<InventoryParkingList>
|
||||||
get() = _inventoryListParking
|
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>() }
|
private val _responseCode by lazy { MutableLiveData<String>() }
|
||||||
val responseCode: LiveData<ResponseItemVO>
|
val responseCode: LiveData<String>
|
||||||
get() = _responseCode
|
get() = _responseCode
|
||||||
val loadReponseCode: LiveData<Event<ResponseItemVO>> = _responseCode.map { Event(it) }
|
val loadReponseCode: LiveData<Event<String>> = _responseCode.map { Event(it) }
|
||||||
|
|
||||||
//sergio para obtener comprador
|
//sergio para obtener comprador
|
||||||
fun itemShelvingBuyerGet() {
|
fun itemShelvingBuyerGet() {
|
||||||
|
@ -84,6 +84,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
val loadInventaryList: LiveData<Event<InventaryListVO>> = _inventaryList.map { Event(it) }
|
val loadInventaryList: LiveData<Event<InventaryListVO>> = _inventaryList.map { Event(it) }
|
||||||
|
|
||||||
fun getInventory(buyerFk: Int, warehouseFk: Int) {
|
fun getInventory(buyerFk: Int, warehouseFk: Int) {
|
||||||
|
@ -105,7 +106,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
salix.itemShelvingUpdate(itemShelvingFk, params)
|
salix.itemShelvingUpdate(itemShelvingFk, params)
|
||||||
.enqueue(object : SalixCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
_responseReset.value = response.message()
|
||||||
super.onSuccess(response)
|
super.onSuccess(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,27 +122,16 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
salix.itemShelvingsUpdate(where, params).enqueue(object : SalixCallback<Any>(context) {
|
salix.itemShelvingsUpdate(where, params).enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_responseReset.value =
|
_responseReset.value = response.message()
|
||||||
ResponseItemVO(isError = false, response = response.message())
|
|
||||||
super.onSuccess(response)
|
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(
|
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))
|
||||||
|
@ -157,7 +147,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
.enqueue(object : SalixCallback<List<DepartmentMistake>>(context) {
|
.enqueue(object : SalixCallback<List<DepartmentMistake>>(context) {
|
||||||
override fun onSuccess(response: Response<List<DepartmentMistake>>) {
|
override fun onSuccess(response: Response<List<DepartmentMistake>>) {
|
||||||
_mistakeDepartmentList.value =
|
_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) {
|
.enqueue(object : SalixCallback<List<WorkerFromMistake>>(context) {
|
||||||
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
|
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
|
||||||
_workerFromMistakeList.value =
|
_workerFromMistakeList.value =
|
||||||
response.body()?.let { workerFromMistakeList(it) }
|
response.body()?.let { WorkerFromMistakeList(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(t: Throwable) {
|
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) {
|
salix.workerMistakesTypes().enqueue(object : SalixCallback<List<MistakeType>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<MistakeType>>) {
|
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)
|
salix.getInventoryParking(vParkingFrom, vParkingTo)
|
||||||
.enqueue(object : SalixCallback<List<ItemInventoryParking>>(context) {
|
.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>>) {
|
override fun onSuccess(response: Response<List<ItemInventoryParking>>) {
|
||||||
|
|
||||||
if (response.body() != null) {
|
|
||||||
_inventoryListParking.value =
|
_inventoryListParking.value =
|
||||||
response.body()?.let { InventoryParkingList(it) }
|
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() {
|
fun expeditionMistakeTypeGet() {
|
||||||
salix.getExpeditionMistakeTypes()
|
salix.getExpeditionMistakeTypes()
|
||||||
.enqueue(object : SalixCallback<List<MistakeType>>(context) {
|
.enqueue(object : SalixCallback<List<MistakeType>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<MistakeType>>) {
|
override fun onSuccess(response: Response<List<MistakeType>>) {
|
||||||
_mistakeWorkerList.value =
|
_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) {
|
salix.barcodes_toitem(code).enqueue(object : SalixCallback<String?>(context) {
|
||||||
override fun onSuccess(response: Response<String?>) {
|
override fun onSuccess(response: Response<String?>) {
|
||||||
_responseCode.value =
|
_responseCode.value =
|
||||||
ResponseItemVO(isError = false, response = response.body()!!.toString())
|
response.body()!!.toString()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@ class ItemInventaryVO(
|
||||||
var downstairs: Int? = null,
|
var downstairs: Int? = null,
|
||||||
var upstairs: Int? = null,
|
var upstairs: Int? = null,
|
||||||
var nicho: Int? = null,
|
var nicho: Int? = null,
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = "",
|
|
||||||
var itemColour: String = ""
|
var itemColour: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,12 +39,8 @@ data class ItemInventoryParking(
|
||||||
var visible: Int = 0,
|
var visible: Int = 0,
|
||||||
var sectorFk: Int = 0,
|
var sectorFk: Int = 0,
|
||||||
var buyer: String = "",
|
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 isChecked: Int? = null,
|
||||||
var priority: Int = 0,
|
var priority: Int = 0,
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = "",
|
|
||||||
var url:String? = null,
|
var url:String? = null,
|
||||||
var image:String? = null
|
var image:String? = null
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,13 +5,10 @@ import android.content.Intent
|
||||||
import android.content.pm.PackageInfo
|
import android.content.pm.PackageInfo
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.datastore.preferences.core.stringPreferencesKey
|
import androidx.datastore.preferences.core.stringPreferencesKey
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||||
import com.google.firebase.ktx.Firebase
|
import com.google.firebase.ktx.Firebase
|
||||||
|
@ -19,6 +16,7 @@ import es.verdnatura.MobileApplication
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentLoginBinding
|
import es.verdnatura.databinding.FragmentLoginBinding
|
||||||
import es.verdnatura.domain.ConstAndValues.ANDROID_ID
|
import es.verdnatura.domain.ConstAndValues.ANDROID_ID
|
||||||
|
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
||||||
import es.verdnatura.domain.ConstAndValues.PASSWORD
|
import es.verdnatura.domain.ConstAndValues.PASSWORD
|
||||||
import es.verdnatura.domain.ConstAndValues.REMEMBER
|
import es.verdnatura.domain.ConstAndValues.REMEMBER
|
||||||
import es.verdnatura.domain.ConstAndValues.RENEWINTERVAL
|
import es.verdnatura.domain.ConstAndValues.RENEWINTERVAL
|
||||||
|
@ -43,7 +41,7 @@ import kotlinx.coroutines.runBlocking
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
class LoginFragment(var imageUri: Uri?) :
|
class LoginFragment(private var imageUri: Uri?) :
|
||||||
BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
|
BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginViewModel::class) {
|
||||||
|
|
||||||
private lateinit var customDialog: CustomDialog
|
private lateinit var customDialog: CustomDialog
|
||||||
|
@ -58,7 +56,6 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_login
|
override fun getLayoutId(): Int = R.layout.fragment_login
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
customDialogList = CustomDialogList(requireContext())
|
customDialogList = CustomDialogList(requireContext())
|
||||||
customDialog = CustomDialog(requireContext())
|
customDialog = CustomDialog(requireContext())
|
||||||
|
@ -76,7 +73,6 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
if (mobileApplication.dataStoreApp.readDataStoreKey<String>(TOKEN)
|
if (mobileApplication.dataStoreApp.readDataStoreKey<String>(TOKEN)
|
||||||
.isNotBlank() && binding.switchRemember.isChecked
|
.isNotBlank() && binding.switchRemember.isChecked
|
||||||
) {
|
) {
|
||||||
//viewModel.operator_add()
|
|
||||||
if (getDevicePDA() != null) {
|
if (getDevicePDA() != null) {
|
||||||
viewModel.getSerialNumber(getDevicePDA()!!)
|
viewModel.getSerialNumber(getDevicePDA()!!)
|
||||||
} else {
|
} else {
|
||||||
|
@ -96,8 +92,9 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
runBlocking { mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, false) }
|
runBlocking { mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, false) }
|
||||||
}
|
}
|
||||||
|
|
||||||
var myWorkFormSlected =
|
val myWorkFormSlected =
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WORKFORMSELECTED) as String
|
mobileApplication.dataStoreApp.readDataStoreKey(WORKFORMSELECTED) as String
|
||||||
|
|
||||||
if (myWorkFormSlected.isBlank()) {
|
if (myWorkFormSlected.isBlank()) {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
|
@ -105,9 +102,7 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
)
|
)
|
||||||
mobileApplication.dataStoreApp.saveWorkForm(
|
mobileApplication.dataStoreApp.saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
"Producción",
|
"Producción", "https://salix.verdnatura.es"
|
||||||
"https://app.verdnatura.es",
|
|
||||||
"https://salix.verdnatura.es"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -116,12 +111,10 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WORKFORMSELECTED) as String
|
mobileApplication.dataStoreApp.readDataStoreKey(WORKFORMSELECTED) as String
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if (binding.edittextServer.text.toString() == "TestLOCAL") {
|
if (binding.edittextServer.text.toString() == "TestLOCAL") {
|
||||||
binding.edittextUsername.setText("developer")
|
binding.edittextUsername.setText(getString(R.string.userDev))
|
||||||
binding.edittextPassword.setText("nightmare")
|
binding.edittextPassword.setText(getString(R.string.passDev))
|
||||||
}
|
}
|
||||||
// se crean/listan las opciones de formas de trabajo
|
|
||||||
//deleteWorkForm("all")
|
//deleteWorkForm("all")
|
||||||
listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
|
listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
|
||||||
binding.edittextServer.keyListener = null
|
binding.edittextServer.keyListener = null
|
||||||
|
@ -140,8 +133,7 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
private fun getDevicePDA(): Int? {
|
private fun getDevicePDA(): Int? {
|
||||||
return try {
|
return try {
|
||||||
Settings.Global.getString(
|
Settings.Global.getString(
|
||||||
mobileApplication.contentResolver,
|
mobileApplication.contentResolver, Settings.Global.DEVICE_NAME
|
||||||
Settings.Global.DEVICE_NAME
|
|
||||||
).toInt()
|
).toInt()
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
null
|
null
|
||||||
|
@ -183,10 +175,7 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
binding.edittextServer.setText(item.name)
|
binding.edittextServer.setText(item.name)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
mobileApplication.dataStoreApp.editDataStoreKey(
|
||||||
"base_url", item.urlSilex
|
BASEURLSALIX, item.urlSalix
|
||||||
)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
"base_urlSalix", item.urlSalix
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +192,7 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
|
|
||||||
}
|
}
|
||||||
}, object : OnTrashItemRowClickListener {
|
}, object : OnTrashItemRowClickListener {
|
||||||
override fun OnTrashItemRowClickListener(workForm: WorkForms) {
|
override fun OnTrashItemRowClickListener(item: WorkForms) {
|
||||||
|
|
||||||
customDialog.setTitle(getString(R.string.deleteWorkForm))
|
customDialog.setTitle(getString(R.string.deleteWorkForm))
|
||||||
.setDescription(getString(R.string.deleteWorkFormConfirmation))
|
.setDescription(getString(R.string.deleteWorkFormConfirmation))
|
||||||
|
@ -211,15 +200,14 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
}.setOkButton(getString(R.string.ok)) {
|
}.setOkButton(getString(R.string.ok)) {
|
||||||
|
|
||||||
val workFormNameKey = stringPreferencesKey(workForm.name)
|
val workFormNameKey = stringPreferencesKey(item.name)
|
||||||
|
|
||||||
runBlocking {
|
runBlocking {
|
||||||
mobileApplication.dataStoreApp.deleteWorkForm(
|
mobileApplication.dataStoreApp.deleteWorkForm(
|
||||||
workFormNameKey
|
workFormNameKey
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// deleteWorkForm(workForm.name)
|
workFormAdapter!!.notifyItemRemoved(listWorkForms.indexOf(item))
|
||||||
workFormAdapter!!.notifyDataSetChanged()
|
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
customDialogList.dismiss()
|
customDialogList.dismiss()
|
||||||
exitProcess(1)
|
exitProcess(1)
|
||||||
|
@ -257,7 +245,7 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
|
|
||||||
private fun showWorkingForms() {
|
private fun showWorkingForms() {
|
||||||
|
|
||||||
var listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
|
val listForms = runBlocking { mobileApplication.dataStoreApp.getWorkForm() }
|
||||||
setAdapter(listForms)
|
setAdapter(listForms)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,10 +264,7 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
runBlocking {
|
runBlocking {
|
||||||
mobileApplication.dataStoreApp.saveWorkForm(
|
mobileApplication.dataStoreApp.saveWorkForm(
|
||||||
WorkForms(
|
WorkForms(
|
||||||
customNewForm.getValue(),
|
customNewForm.getValue(), customNewForm.getValueThree(), true
|
||||||
customNewForm.getValueTwo(),
|
|
||||||
customNewForm.getValueThree(),
|
|
||||||
true
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -398,10 +383,8 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
runBlocking {
|
runBlocking {
|
||||||
if (binding.switchRemember.isChecked) {
|
if (binding.switchRemember.isChecked) {
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, true)
|
mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, true)
|
||||||
//saveRemember(true)
|
|
||||||
} else {
|
} else {
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, false)
|
mobileApplication.dataStoreApp.editDataStoreKey(REMEMBER, false)
|
||||||
//saveRemember(false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (it.vIsAuthorized == "1") {
|
if (it.vIsAuthorized == "1") {
|
||||||
|
@ -439,8 +422,6 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//saveDataOperator(it)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
operatorAdd.observe(viewLifecycleOwner) {
|
operatorAdd.observe(viewLifecycleOwner) {
|
||||||
|
@ -488,18 +469,13 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
}.show()
|
}.show()
|
||||||
} else {
|
} else {
|
||||||
saveTokenPref(it.token, it.ttl)
|
saveTokenPref(it.token, it.ttl)
|
||||||
//test
|
|
||||||
//saveTokenPref("RTymwJzRuVchAMY5u8xG2wpgcjPf7t0DQImLvMsTdNFmbFwDiVsa8lA6fr1XSaBo","2026-29-06")
|
|
||||||
// local
|
|
||||||
//saveTokenPref("1ZGV1OGhpcrZZwvNALXnPeSVe0GCE4tgpKbv8nZu4EXay75QZrVY5GZDnpsqlxFz",it.ttl )
|
|
||||||
|
|
||||||
app.userName = binding.edittextUsername.text.toString()
|
app.userName = binding.edittextUsername.text.toString()
|
||||||
app.userPassword = binding.edittextPassword.text.toString()
|
app.userPassword = binding.edittextPassword.text.toString()
|
||||||
|
|
||||||
viewModel.getAccessTokenConfigs()
|
viewModel.getAccessTokenConfigs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadAccessConfigSalixList.observe(viewLifecycleOwner, Observer { event ->
|
loadAccessConfigSalixList.observe(viewLifecycleOwner) { event ->
|
||||||
|
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
|
|
||||||
|
@ -517,7 +493,6 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// viewModel.operator_add()
|
|
||||||
if (getDevicePDA() != null) {
|
if (getDevicePDA() != null) {
|
||||||
viewModel.getSerialNumber(getDevicePDA()!!)
|
viewModel.getSerialNumber(getDevicePDA()!!)
|
||||||
} else {
|
} else {
|
||||||
|
@ -528,14 +503,13 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
it.list[0].errorMessage.toast(context)
|
it.list[0].errorMessage.toast(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
super.observeViewModel()
|
super.observeViewModel()
|
||||||
|
@ -577,6 +551,4 @@ class LoginFragment(var imageUri: Uri?) :
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.VersionApp
|
||||||
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
|
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
|
||||||
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalixList
|
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 kotlinx.coroutines.runBlocking
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
import java.util.Date
|
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 gson = Gson()
|
||||||
val list = mutableListOf<itemsExpeditionDynamics>()
|
val list = mutableListOf<ItemsExpeditionDynamics>()
|
||||||
val expeditionState: Map<String, Any> =
|
val expeditionState: Map<String, Any> =
|
||||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||||
expeditionState.forEach {
|
expeditionState.forEach {
|
||||||
|
|
||||||
list.add(itemsExpeditionDynamics(key = it.key, value = it.value.toString()))
|
list.add(ItemsExpeditionDynamics(key = it.key, value = it.value.toString()))
|
||||||
|
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
package es.verdnatura.presentation.view.feature.login.model
|
package es.verdnatura.presentation.view.feature.login.model
|
||||||
|
|
||||||
import java.util.*
|
import java.util.Calendar
|
||||||
|
|
||||||
class WorkForms(
|
class WorkForms(
|
||||||
val name: String,
|
val name: String,
|
||||||
val urlSilex: String,
|
|
||||||
val urlSalix: String,
|
val urlSalix: String,
|
||||||
val isShowDelete: Boolean = false,
|
val isShowDelete: Boolean = false,
|
||||||
val created: Long = Calendar.getInstance().timeInMillis
|
val created: Long = Calendar.getInstance().timeInMillis
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package es.verdnatura.presentation.view.feature.main.activity
|
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.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.media.MediaPlayer
|
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.BufferFragment
|
||||||
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferLoadFragment
|
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferLoadFragment
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemFragment
|
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.CollectionFragment
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPicker
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionFragmentPickerNew
|
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.EndSacadorFragment
|
||||||
import es.verdnatura.presentation.view.feature.presacador.fragment.SectorCollectionReserveFragment
|
import es.verdnatura.presentation.view.feature.presacador.fragment.SectorCollectionReserveFragment
|
||||||
import es.verdnatura.presentation.view.feature.qr.QrFragment
|
import es.verdnatura.presentation.view.feature.qr.QrFragment
|
||||||
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationCollectionFragment
|
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.fragment.ReubicationCollectionFragment
|
||||||
import es.verdnatura.presentation.view.feature.reubication.fragment.ReubicationFragment
|
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.fragment.ReubicationFragment
|
||||||
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.fragment.PickerHelperFragment
|
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.SacadorFragment
|
||||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragmentNew
|
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorFragmentNew
|
||||||
|
@ -143,9 +143,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
private val _renewTokenResponse = MutableLiveData<RenewToken>()
|
private val _renewTokenResponse = MutableLiveData<RenewToken>()
|
||||||
private lateinit var networkUtils: NetworkUtilsApp
|
private lateinit var networkUtils: NetworkUtilsApp
|
||||||
private var myTimeUserInteraction = (System.currentTimeMillis() / 1000 / 3600)
|
private var myTimeUserInteraction = (System.currentTimeMillis() / 1000 / 3600)
|
||||||
private var comeFromDelivery: Boolean? = null
|
|
||||||
private lateinit var mainActivityViewmodel: MainActivityViewModel
|
private lateinit var mainActivityViewmodel: MainActivityViewModel
|
||||||
val backDispatcher = onBackPressedDispatcher
|
private val backDispatcher = onBackPressedDispatcher
|
||||||
override fun getLayoutId(): Int = R.layout.activity_main
|
override fun getLayoutId(): Int = R.layout.activity_main
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
@ -701,7 +700,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(R.string.titleClaimUbication) -> {
|
getString(R.string.titleClaimUbication) -> {
|
||||||
addFragmentOnTop(ClaimFragment.newInstance(item.title))
|
addFragmentOnTop(ClaimUbicationFragment.newInstance(item.title))
|
||||||
}
|
}
|
||||||
|
|
||||||
getString(R.string.titleReUbicator) -> {
|
getString(R.string.titleReUbicator) -> {
|
||||||
|
@ -755,11 +754,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
getString(R.string.titleInfo) -> {
|
getString(R.string.titleInfo) -> {
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
InfoFragment.newInstance(item.title), if (comeFromDelivery == true) {
|
InfoFragment.newInstance(item.title),
|
||||||
getString(R.string.titleInfo)
|
getString(R.string.titleInfo)
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -767,11 +764,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
getString(R.string.titleLog) -> {
|
getString(R.string.titleLog) -> {
|
||||||
|
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
LogExpeditionFragment.newInstance(item.title), if (comeFromDelivery == true) {
|
LogExpeditionFragment.newInstance(item.title),
|
||||||
getString(R.string.titleLog)
|
getString(R.string.titleLog)
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -779,11 +773,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
getString(R.string.titleLoadTruck) -> {
|
getString(R.string.titleLoadTruck) -> {
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
LoadUnloadFragment.newInstance(item.title, "ON DELIVERY", entryPoint),
|
LoadUnloadFragment.newInstance(item.title, "ON DELIVERY", entryPoint),
|
||||||
if (comeFromDelivery == true) {
|
|
||||||
getString(R.string.titleLoadTruck)
|
getString(R.string.titleLoadTruck)
|
||||||
} else {
|
|
||||||
getString(R.string.titleLoadTruck)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -797,11 +788,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
), if (comeFromDelivery == true) {
|
),
|
||||||
getString(R.string.titleUnLoadTruck)
|
getString(R.string.titleUnLoadTruck)
|
||||||
} else {
|
, delete = true
|
||||||
getString(R.string.titleUnLoadTruck)
|
|
||||||
}, delete = true
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -810,11 +799,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
SummaryFragment.newInstance(item.title, "ON DELIVERY", entryPoint.toInt()),
|
SummaryFragment.newInstance(item.title, "ON DELIVERY", entryPoint.toInt()),
|
||||||
if (comeFromDelivery == true) {
|
|
||||||
getString(R.string.titleDeliverySummary)
|
getString(R.string.titleDeliverySummary)
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -822,11 +807,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
getString(R.string.titleDeliveryRoute) -> {
|
getString(R.string.titleDeliveryRoute) -> {
|
||||||
|
|
||||||
addFragmentOnTop(
|
addFragmentOnTop(
|
||||||
RoutesFragment.newInstance(item.title), if (comeFromDelivery == true) {
|
RoutesFragment.newInstance(item.title),
|
||||||
getString(R.string.titleDeliverySummary)
|
getString(R.string.titleDeliverySummary)
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -845,7 +827,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
||||||
|
|
||||||
getString(R.string.testing) -> {
|
getString(R.string.testing) -> {
|
||||||
// addFragmentOnTop(
|
// addFragmentOnTop(
|
||||||
// PhotosFragment.newInstance(item.title))
|
// es.verdnatura.presentation.view.feature.photos.fragment.PhotosFragment.newInstance(item.title))
|
||||||
//addFragmentOnTop(testPrint.newInstance(item.title))
|
//addFragmentOnTop(testPrint.newInstance(item.title))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentPackagingCountBinding
|
import es.verdnatura.databinding.FragmentPackagingCountBinding
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
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.CustomDialog
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||||
import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
|
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.packaging.model.ItemSupplier
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class PackagingCountFragment(
|
class PackagingCountFragment(
|
||||||
var entryPoint: String = ""
|
var entryPoint: String = ""
|
||||||
|
@ -89,7 +93,7 @@ class PackagingCountFragment(
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
requireActivity().onBackPressed()
|
ma.onMyBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,13 @@ import es.verdnatura.domain.ConstAndValues.ENTRYTYPE
|
||||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERID
|
import es.verdnatura.domain.ConstAndValues.SUPPLIERID
|
||||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
|
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.*
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||||
|
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
import es.verdnatura.presentation.view.component.CustomDialog
|
||||||
import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
|
import es.verdnatura.presentation.view.feature.packaging.adapter.ItemSupplierAdapter
|
||||||
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
|
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
|
||||||
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class PackagingSummaryFragment(
|
class PackagingSummaryFragment(
|
||||||
var entryPoint: String = ""
|
var entryPoint: String = ""
|
||||||
|
@ -91,7 +92,7 @@ class PackagingSummaryFragment(
|
||||||
|
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
requireActivity().onBackPressed()
|
ma.onMyBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,6 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
get() = _response
|
get() = _response
|
||||||
|
|
||||||
val loadEntryAdd: LiveData<Event<EntrySalix>> = _entryAdd.map { Event(it) }
|
val loadEntryAdd: LiveData<Event<EntrySalix>> = _entryAdd.map { Event(it) }
|
||||||
//val loadEntryAdd = Transformations.map(_entryAdd) { Event(it) }
|
|
||||||
|
|
||||||
fun getSuppliers() {
|
fun getSuppliers() {
|
||||||
salix.getSuppliers()
|
salix.getSuppliers()
|
||||||
|
|
|
@ -129,7 +129,7 @@ class SupplierFragment(
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
requireActivity().onBackPressed()
|
ma.onMyBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ class SupplierFragment(
|
||||||
private fun createEntryList(list: List<EntrySalix>) {
|
private fun createEntryList(list: List<EntrySalix>) {
|
||||||
entries.clear()
|
entries.clear()
|
||||||
list.forEach { entry ->
|
list.forEach { entry ->
|
||||||
if (!entry.isError!!) {
|
if (!entry.isError) {
|
||||||
try {
|
try {
|
||||||
entries.add(
|
entries.add(
|
||||||
SearchSupplierModel(
|
SearchSupplierModel(
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.lifecycle.LiveData
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
|
|
||||||
class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
|
class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
|
||||||
val response: LiveData<ResponseItemVO>
|
|
||||||
get() = _response
|
|
||||||
|
|
||||||
fun travelUpdatePacking(
|
fun travelUpdatePacking(
|
||||||
itemFk: Int,
|
itemFk: Int,
|
||||||
packingFk: Int
|
packingFk: Int
|
||||||
|
|
|
@ -39,12 +39,13 @@ class CmrExpeditionPalletFragment(
|
||||||
binding.mainToolbar.toolbarTitle.text = title
|
binding.mainToolbar.toolbarTitle.text = title
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun cmrExpeditionPallet_add(vExpeditionPallet: Int?, vCmrId: Int?) {
|
private fun cmrExpeditionPalletAdd(vExpeditionPallet: Int?, vCmrId: Int?) {
|
||||||
|
|
||||||
customDialogList.dismiss()
|
|
||||||
viewModel.cmrExpeditionPalletAdd(
|
viewModel.cmrExpeditionPalletAdd(
|
||||||
vExpeditionPallet!!, vCmrId!!
|
vExpeditionPallet!!, vCmrId!!
|
||||||
)
|
)
|
||||||
|
customDialogList.dismiss()
|
||||||
|
showExpeditionPalletScan()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,18 +58,6 @@ class CmrExpeditionPalletFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun observeViewModel() {
|
|
||||||
|
|
||||||
with(viewModel) {
|
|
||||||
|
|
||||||
responsescan.observe(viewLifecycleOwner) {
|
|
||||||
showExpeditionPalletScan()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showExpeditionPalletScan() {
|
private fun showExpeditionPalletScan() {
|
||||||
customDialogList.setHint(true)
|
customDialogList.setHint(true)
|
||||||
customDialogList.setValue("")
|
customDialogList.setValue("")
|
||||||
|
@ -118,7 +107,7 @@ class CmrExpeditionPalletFragment(
|
||||||
) {
|
) {
|
||||||
dataScannedTwo = itemScan(customDialogList.getValueTwo())
|
dataScannedTwo = itemScan(customDialogList.getValueTwo())
|
||||||
if (dataScannedTwo == null) {
|
if (dataScannedTwo == null) {
|
||||||
cmrExpeditionPallet_add(
|
cmrExpeditionPalletAdd(
|
||||||
customDialogList.getValue().toInt(),
|
customDialogList.getValue().toInt(),
|
||||||
customDialogList.getValueTwo().toInt()
|
customDialogList.getValueTwo().toInt()
|
||||||
)
|
)
|
||||||
|
@ -137,7 +126,7 @@ class CmrExpeditionPalletFragment(
|
||||||
customDialogList.setValueTwo("")
|
customDialogList.setValueTwo("")
|
||||||
} else {
|
} else {
|
||||||
customDialogList.setValueTwo(dataScanned!!.id.toString())
|
customDialogList.setValueTwo(dataScanned!!.id.toString())
|
||||||
cmrExpeditionPallet_add(
|
cmrExpeditionPalletAdd(
|
||||||
if (dataScannedTwo!!.table == "cmr") {
|
if (dataScannedTwo!!.table == "cmr") {
|
||||||
dataScanned!!.id
|
dataScanned!!.id
|
||||||
} else {
|
} else {
|
||||||
|
@ -150,7 +139,7 @@ class CmrExpeditionPalletFragment(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmrExpeditionPallet_add(
|
cmrExpeditionPalletAdd(
|
||||||
customDialogList.getValue().toInt(), dataScannedTwo!!.id
|
customDialogList.getValue().toInt(), dataScannedTwo!!.id
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,37 +1,14 @@
|
||||||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.lifecycle.LiveData
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import retrofit2.Response
|
|
||||||
|
|
||||||
class CmrExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
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) {
|
fun cmrExpeditionPalletAdd(vExpeditionPallet: Int, cmrFk: Int) {
|
||||||
salix.cmrPalletAdd(arrayListOf(vExpeditionPallet, cmrFk))
|
salix.cmrPalletAdd(arrayListOf(vExpeditionPallet, cmrFk))
|
||||||
.enqueue(object : SalixCallback<Unit>(context) {
|
.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)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,22 +5,19 @@ import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(context) {
|
class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _responsescan by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseScan by lazy { MutableLiveData<String>() }
|
||||||
val responsescan: LiveData<ResponseItemVO>
|
val responsescan: LiveData<String>
|
||||||
get() = _responsescan
|
get() = _responseScan
|
||||||
|
|
||||||
fun expeditionScan(vExpeditionId: String) {
|
fun expeditionScan(vExpeditionId: String) {
|
||||||
salix.expeditionScan(params = arrayListOf(vExpeditionId))
|
salix.expeditionScan(params = arrayListOf(vExpeditionId))
|
||||||
.enqueue(object : SalixCallback<Unit>(context) {
|
.enqueue(object : SalixCallback<Unit>(context) {
|
||||||
override fun onSuccess(response: Response<Unit>) {
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_responseScan.value = response.message()
|
||||||
_responsescan.value =
|
|
||||||
ResponseItemVO(isError = false, response = response.message()!!)
|
|
||||||
super.onSuccess(response)
|
super.onSuccess(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding
|
||||||
import es.verdnatura.domain.toInt
|
import es.verdnatura.domain.toInt
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionStateAdapter
|
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.ItemExpeditionStateRow
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class ExpeditionStateFragment(
|
class ExpeditionStateFragment(
|
||||||
|
@ -72,13 +72,13 @@ class ExpeditionStateFragment(
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
itemexpedition.observe(viewLifecycleOwner) {
|
itemExpedition.observe(viewLifecycleOwner) {
|
||||||
setItemExpeditionState(it)
|
setItemExpeditionState(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setItemExpeditionState(itemInfo: itemExpedetionState) {
|
private fun setItemExpeditionState(itemInfo: ItemExpedetionState) {
|
||||||
setToolBar(getString(R.string.expedition) + " " + itemScan)
|
setToolBar(getString(R.string.expedition) + " " + itemScan)
|
||||||
binding.itemcardLayout.visibility = View.VISIBLE
|
binding.itemcardLayout.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||||
|
|
||||||
//import es.verdnatura.presentation.view.feature.paletizador.model.itemExpeditionDynamicsList
|
//import es.verdnatura.presentation.view.feature.paletizador.model.itemExpeditionDynamicsList
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
@ -12,24 +10,22 @@ import com.google.gson.reflect.TypeToken
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.isoToString
|
import es.verdnatura.domain.isoToString
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
|
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.ItemsExpeditionDynamics
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _itemexpedition by lazy { MutableLiveData<itemExpedetionState>() }
|
private val _itemExpedition by lazy { MutableLiveData<ItemExpedetionState>() }
|
||||||
val itemexpedition: LiveData<itemExpedetionState>
|
val itemExpedition: LiveData<ItemExpedetionState>
|
||||||
get() = _itemexpedition
|
get() = _itemExpedition
|
||||||
|
|
||||||
fun expeditionGetStateJSON(expeditionFk: Int) {
|
fun expeditionGetStateJSON(expeditionFk: Int) {
|
||||||
salix.expedition_getState(params = arrayListOf(expeditionFk))
|
salix.expedition_getState(params = arrayListOf(expeditionFk))
|
||||||
.enqueue(object : SalixCallback<ArrayList<JsonObject>>(context) {
|
.enqueue(object : SalixCallback<ArrayList<JsonObject>>(context) {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun onSuccess(response: Response<ArrayList<JsonObject>>) {
|
override fun onSuccess(response: Response<ArrayList<JsonObject>>) {
|
||||||
_itemexpedition.value = itemExpedetionState(
|
_itemExpedition.value = ItemExpedetionState(
|
||||||
isError = false,
|
|
||||||
errorMessage = "",
|
|
||||||
list = if (response.body()!!.size > 0) {
|
list = if (response.body()!!.size > 0) {
|
||||||
getListFromJSON(response.body()!![0].asJsonObject)
|
getListFromJSON(response.body()!![0].asJsonObject)
|
||||||
} else {
|
} 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()
|
val gson = Gson()
|
||||||
var list = mutableListOf<itemsExpeditionDynamics>()
|
val list = mutableListOf<ItemsExpeditionDynamics>()
|
||||||
var expeditionState: Map<String, String?> =
|
val expeditionState: Map<String, String?> =
|
||||||
gson.fromJson(json, object : TypeToken<Map<String, String?>>() {}.type)
|
gson.fromJson(json, object : TypeToken<Map<String, String?>>() {}.type)
|
||||||
expeditionState.forEach {
|
expeditionState.forEach {
|
||||||
list.add(itemsExpeditionDynamics(key = it.key, it.value ?: ""))
|
list.add(ItemsExpeditionDynamics(key = it.key, it.value ?: ""))
|
||||||
}
|
}
|
||||||
list.forEach { element ->
|
list.forEach { element ->
|
||||||
if (element.value!!.takeLast(4).matches(Regex("[0-9]{3}Z"))) {
|
if (element.value!!.takeLast(4).matches(Regex("[0-9]{3}Z"))) {
|
||||||
|
|
|
@ -3,11 +3,8 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentExpeditionTruckListBinding
|
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.inventario.adapter.ToolBarAdapter
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionListAdapter
|
import es.verdnatura.presentation.view.feature.paletizador.adapter.ExpeditionListAdapter
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckList
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckList
|
||||||
import java.text.SimpleDateFormat
|
import java.time.LocalDate
|
||||||
import java.util.*
|
import java.time.format.DateTimeFormatter
|
||||||
import java.util.Calendar.getInstance as getInstance1
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||||
class ExpeditionTruckListFragment :
|
class ExpeditionTruckListFragment :
|
||||||
|
@ -45,11 +41,11 @@ class ExpeditionTruckListFragment :
|
||||||
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_expedition_truck_list
|
override fun getLayoutId(): Int = R.layout.fragment_expedition_truck_list
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
override fun init() {
|
override fun init() {
|
||||||
customDialogHor = CustomDialogHour(requireContext())
|
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 {
|
binding.mainToolbar.backButton.setOnClickListener {
|
||||||
ma.onMyBackPressed()
|
ma.onMyBackPressed()
|
||||||
}
|
}
|
||||||
|
@ -75,7 +71,6 @@ class ExpeditionTruckListFragment :
|
||||||
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
binding.mainToolbar.toolbarIcons.adapter =
|
||||||
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
override fun onOptionsItemSelected(item: Drawable) {
|
||||||
if (item == iconReload) {
|
if (item == iconReload) {
|
||||||
viewModel.expeditionTruckList()
|
viewModel.expeditionTruckList()
|
||||||
|
@ -91,34 +86,25 @@ class ExpeditionTruckListFragment :
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
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() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadExpeditionTruckList.observe(viewLifecycleOwner, Observer { event ->
|
loadExpeditionTruckList.observe(viewLifecycleOwner) { event ->
|
||||||
event.getContentIfNotHandled().notNull { printExpeditionList(it) }
|
event.getContentIfNotHandled().notNull { printExpeditionList(it) }
|
||||||
})
|
}
|
||||||
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
|
loadResponseExpeditionAdd.observe(viewLifecycleOwner) { event ->
|
||||||
viewModel.expeditionTruckList()
|
viewModel.expeditionTruckList()
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun printExpeditionList(it: ItemExpeditionTruckList) {
|
private fun printExpeditionList(it: ItemExpeditionTruckList) {
|
||||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
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!!)
|
adapter = ExpeditionListAdapter(it.list, onTruckClickListener!!)
|
||||||
binding.expeditionTruckRecyclerview.adapter = adapter
|
binding.expeditionTruckRecyclerview.adapter = adapter
|
||||||
binding.expeditionTruckRecyclerview.layoutManager = lm
|
binding.expeditionTruckRecyclerview.layoutManager = lm
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun addTruck() {
|
private fun addTruck() {
|
||||||
customDialogHor.setTitle(getString(R.string.newTruck))
|
customDialogHor.setTitle(getString(R.string.newTruck))
|
||||||
.setOkButton(getString(R.string.save)) {
|
.setOkButton(getString(R.string.save)) {
|
||||||
|
@ -150,7 +136,6 @@ class ExpeditionTruckListFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun customDialogActionTruck() {
|
private fun customDialogActionTruck() {
|
||||||
viewModel.expeditionTruckAdd(
|
viewModel.expeditionTruckAdd(
|
||||||
customDialogHor.getHoraValue(), customDialogHor.getDestinoValue()
|
customDialogHor.getHoraValue(), customDialogHor.getDestinoValue()
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.map
|
import androidx.lifecycle.map
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.Event
|
import es.verdnatura.presentation.common.Event
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ExpeditionTruckSalix
|
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.ItemExpeditionTruckList
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||||
|
@ -21,14 +18,13 @@ import java.time.LocalTime
|
||||||
class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context) {
|
class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
private val _expeditionTruckList by lazy { MutableLiveData<ItemExpeditionTruckList>() }
|
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>() }
|
private val _response by lazy { MutableLiveData<String>() }
|
||||||
val loadResponseExpeditionAdd: LiveData<Event<ResponseItemVO>> = _response.map { Event(it) }
|
val loadResponseExpeditionAdd: LiveData<Event<String>> = _response.map { Event(it) }
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
fun expeditionTruckList() {
|
fun expeditionTruckList() {
|
||||||
// Tarea 5134 modificar fecha para que se vea correctamente y no con 0.00Z
|
|
||||||
salix.expeditionTruckGet(
|
salix.expeditionTruckGet(
|
||||||
"""{"where": { "eta": {
|
"""{"where": { "eta": {
|
||||||
"between": ["${LocalDate.now().atTime(LocalTime.MIN)}",
|
"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) {
|
fun expeditionTruckAdd(vHour: String, vDescription: String) {
|
||||||
salix.expeditionTrucksInsert(
|
salix.expeditionTrucksInsert(
|
||||||
ExpeditionTruckSalix(
|
ExpeditionTruckSalix(
|
||||||
|
@ -52,7 +47,7 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
|
||||||
)
|
)
|
||||||
).enqueue(object : SalixCallback<Any>(context) {
|
).enqueue(object : SalixCallback<Any>(context) {
|
||||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
_response.value = response.message()
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -55,23 +55,9 @@ class PalletScanFragment(
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
|
|
||||||
with(viewModel) {
|
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) {
|
responsePalletGet.observe(viewLifecycleOwner) {
|
||||||
|
ma.messageWithSound(message = "", isError = false, isPlayed = true, isToasted = false)
|
||||||
ma.messageWithSound(getString(R.string.palletScanned) + itemScaned, false, true)
|
|
||||||
ma.onComprobarPalletFromPalletScan(
|
ma.onComprobarPalletFromPalletScan(
|
||||||
ItemExpeditionTruckVO(it.truckFk), ItemPalletVO(Pallet = itemScaned)
|
ItemExpeditionTruckVO(it.truckFk), ItemPalletVO(Pallet = itemScaned)
|
||||||
)
|
)
|
||||||
|
@ -117,9 +103,12 @@ class PalletScanFragment(
|
||||||
ma.hideKeyboard(customDialogList.getEditText())
|
ma.hideKeyboard(customDialogList.getEditText())
|
||||||
|
|
||||||
when (action) {
|
when (action) {
|
||||||
"receive" -> viewModel.expeditionStateAddByPallet(
|
"receive" -> {
|
||||||
|
viewModel.expeditionStateAddByPallet(
|
||||||
itemScaned, "STORED"
|
itemScaned, "STORED"
|
||||||
)
|
)
|
||||||
|
showPalletScan()
|
||||||
|
}
|
||||||
|
|
||||||
"get" -> viewModel.expeditionPalletGet(
|
"get" -> viewModel.expeditionPalletGet(
|
||||||
itemScaned
|
itemScaned
|
||||||
|
|
|
@ -6,18 +6,11 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckSalix
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckSalix
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
|
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>() }
|
private val _responsePalletGet by lazy { MutableLiveData<ItemExpeditionTruckSalix>() }
|
||||||
val responsePalletGet: LiveData<ItemExpeditionTruckSalix>
|
val responsePalletGet: LiveData<ItemExpeditionTruckSalix>
|
||||||
get() = _responsePalletGet
|
get() = _responsePalletGet
|
||||||
|
@ -33,33 +26,17 @@ class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
).formatWithQuotes()
|
).formatWithQuotes()
|
||||||
)
|
)
|
||||||
.enqueue(object : SalixCallback<Unit>(context) {
|
.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) {
|
fun expeditionPalletGet(vPalletId: Int) {
|
||||||
//Tarea 6276
|
|
||||||
salix.expeditionPalletGet("""{"fields": ["truckFk"], "where": {"id": $vPalletId}, "include": [{"relation": "expeditionTruck", "scope": {"fields": ["eta", "description"]}}]}""")
|
salix.expeditionPalletGet("""{"fields": ["truckFk"], "where": {"id": $vPalletId}, "include": [{"relation": "expeditionTruck", "scope": {"fields": ["eta", "description"]}}]}""")
|
||||||
// silex.expeditionPallet_get(vPalletId)
|
|
||||||
.enqueue(object : SalixCallback<List<ItemExpeditionTruckSalix>>(context) {
|
.enqueue(object : SalixCallback<List<ItemExpeditionTruckSalix>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<ItemExpeditionTruckSalix>>) {
|
override fun onSuccess(response: Response<List<ItemExpeditionTruckSalix>>) {
|
||||||
_responsePalletGet.value =
|
_responsePalletGet.value =
|
||||||
response.body()!![0]
|
response.body()?.get(0)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,14 +30,12 @@ class ItemExpeditionTruckList(
|
||||||
var list: List<ItemExpeditionTruckVO> = listOf()
|
var list: List<ItemExpeditionTruckVO> = listOf()
|
||||||
)
|
)
|
||||||
|
|
||||||
class itemExpedetionState(
|
class ItemExpedetionState(
|
||||||
var isError: Boolean = false,
|
var list: MutableList<ItemsExpeditionDynamics>
|
||||||
var errorMessage: String = "",
|
|
||||||
var list: MutableList<itemsExpeditionDynamics>
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class itemsExpeditionDynamics(
|
class ItemsExpeditionDynamics(
|
||||||
var key: String = "",
|
var key: String = "",
|
||||||
var value: String? = null
|
var value: String? = null
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.parking.fragment
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentParkingBinding
|
import es.verdnatura.databinding.FragmentParkingBinding
|
||||||
|
@ -65,7 +64,7 @@ class ParkingFragment(var menuOrigin: String) :
|
||||||
|
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
response.observe(viewLifecycleOwner, Observer {
|
response.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
message = getString(R.string.Aparcado),
|
message = getString(R.string.Aparcado),
|
||||||
|
@ -79,7 +78,7 @@ class ParkingFragment(var menuOrigin: String) :
|
||||||
setList()
|
setList()
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +88,7 @@ class ParkingFragment(var menuOrigin: String) :
|
||||||
adapter = ParkingAdapter(scanerList, object : OnBarcodeRowClickListener {
|
adapter = ParkingAdapter(scanerList, object : OnBarcodeRowClickListener {
|
||||||
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
override fun onBarcodeRowClickListener(item: BarcodeVO) {
|
||||||
scanerList.removeAt(scanerList.indexOf(item))
|
scanerList.removeAt(scanerList.indexOf(item))
|
||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyItemRemoved(scanerList.indexOf(item))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||||
|
@ -116,7 +115,7 @@ class ParkingFragment(var menuOrigin: String) :
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scanerList.add(BarcodeVO(code = txtScan))
|
scanerList.add(BarcodeVO(code = txtScan))
|
||||||
adapter?.notifyDataSetChanged()
|
adapter?.notifyItemInserted(scanerList.size-1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,11 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.domain.formatWithQuotes
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.common.ResponseItemVO
|
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
|
||||||
class ParkingViewModel(val context: Context) : BaseViewModel(context) {
|
class ParkingViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _response by lazy { MutableLiveData<Any>() }
|
||||||
val response: LiveData<ResponseItemVO>
|
val response: LiveData<Any>
|
||||||
get() = _response
|
get() = _response
|
||||||
|
|
||||||
fun setParking(scanItem: String, parking: String) {
|
fun setParking(scanItem: String, parking: String) {
|
||||||
|
@ -19,7 +18,7 @@ class ParkingViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SalixCallback<Any>(context) {
|
SalixCallback<Any>(context) {
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
_response.value = response.message()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,7 @@ import es.verdnatura.presentation.view.feature.pasillero.adapter.PasillerosAdapt
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
|
|
||||||
class PasilleroFragment(
|
class PasilleroFragment(
|
||||||
private var tagName: String = "",
|
private var tagName: String = "", var isInitMenu: Boolean
|
||||||
var isInitMenu: Boolean
|
|
||||||
) : BaseFragment<FragmentPasilleroBinding, PasilleroViewModel>(PasilleroViewModel::class) {
|
) : BaseFragment<FragmentPasilleroBinding, PasilleroViewModel>(PasilleroViewModel::class) {
|
||||||
|
|
||||||
constructor() : this("", false)
|
constructor() : this("", false)
|
||||||
|
@ -130,7 +129,6 @@ class PasilleroFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
//Tarea 5313
|
|
||||||
viewModel.inititializeDefaultDataInit()
|
viewModel.inititializeDefaultDataInit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,8 +148,7 @@ class PasilleroFragment(
|
||||||
|
|
||||||
if (!isInitMenu) {
|
if (!isInitMenu) {
|
||||||
val dividerItemDecoration = DividerItemDecoration(
|
val dividerItemDecoration = DividerItemDecoration(
|
||||||
context,
|
context, LinearLayoutManager.VERTICAL
|
||||||
LinearLayoutManager.VERTICAL
|
|
||||||
)
|
)
|
||||||
dividerItemDecoration.setDrawable(
|
dividerItemDecoration.setDrawable(
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
package es.verdnatura.presentation.view.feature.photos.fragment
|
||||||
import android.app.Activity.RESULT_OK
|
import android.app.Activity.RESULT_OK
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
@ -5,14 +6,12 @@ import android.graphics.Bitmap
|
||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
import android.view.View.*
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
@ -29,16 +28,16 @@ import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
class PhotosFragment(
|
class PhotosFragment(
|
||||||
var title: String,
|
var title: String,
|
||||||
var uriImage: Uri?
|
private var uriImage: Uri?
|
||||||
) : BaseFragment<FragmentPhotosBinding, ItemCardViewModel>(
|
) : BaseFragment<FragmentPhotosBinding, ItemCardViewModel>(
|
||||||
ItemCardViewModel::class
|
ItemCardViewModel::class
|
||||||
) {
|
) {
|
||||||
private val PICK_IMAGE_REQUEST = 1
|
|
||||||
private val REQUEST_IMAGE_CAPTURE = 2
|
|
||||||
private val imageUri: Uri? = null
|
private val imageUri: Uri? = null
|
||||||
private var originalItem: String = ""
|
private var originalItem: String = ""
|
||||||
private val pickImageLauncher = registerForActivityResult(
|
private val pickImageLauncher = registerForActivityResult(
|
||||||
|
@ -65,7 +64,6 @@ class PhotosFragment(
|
||||||
fun newInstance(title: String, uriImage: String) = PhotosFragment(title, uriImage.toUri())
|
fun newInstance(title: String, uriImage: String) = PhotosFragment(title, uriImage.toUri())
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
binding.mainToolbar.toolbarTitle.text = title
|
binding.mainToolbar.toolbarTitle.text = title
|
||||||
setEvents()
|
setEvents()
|
||||||
|
@ -80,7 +78,6 @@ class PhotosFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
private fun setToolBar() {
|
private fun setToolBar() {
|
||||||
|
|
||||||
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
binding.mainToolbar.toolbarSubtitle.visibility = VISIBLE
|
||||||
|
@ -125,7 +122,7 @@ class PhotosFragment(
|
||||||
|
|
||||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
if (!binding.editItemFk.text.toString().isEmpty()) {
|
if (binding.editItemFk.text.toString().isNotEmpty()) {
|
||||||
try {
|
try {
|
||||||
originalItem = itemScanValue(
|
originalItem = itemScanValue(
|
||||||
binding.editItemFk.text.toString(),
|
binding.editItemFk.text.toString(),
|
||||||
|
@ -136,7 +133,7 @@ class PhotosFragment(
|
||||||
viewModel.getIdFromCodeSalix(originalItem)
|
viewModel.getIdFromCodeSalix(originalItem)
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
ma.messageWithSound(ex.message.toString(), true, true)
|
ma.messageWithSound(ex.message.toString(), isError = true, isPlayed =true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.editItemFk.setText("")
|
binding.editItemFk.setText("")
|
||||||
|
@ -170,12 +167,10 @@ class PhotosFragment(
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
itemcard.observe(viewLifecycleOwner) {
|
itemCard.observe(viewLifecycleOwner) {
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
|
||||||
} else {
|
|
||||||
if (it.id != 0) {
|
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()) {
|
if (!it.urlImage200.isNullOrEmpty()) {
|
||||||
binding.itemcardOriginal.visibility = VISIBLE
|
binding.itemcardOriginal.visibility = VISIBLE
|
||||||
binding.itemcardOriginal.loadUrl(it.urlImage200)
|
binding.itemcardOriginal.loadUrl(it.urlImage200)
|
||||||
|
@ -183,26 +178,25 @@ class PhotosFragment(
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.itemNotFound),
|
getString(R.string.itemNotFound),
|
||||||
true,
|
isError = true,
|
||||||
false,
|
isPlayed = false,
|
||||||
getString(R.string.noResults)
|
getString(R.string.noResults)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
responseCode.observe(viewLifecycleOwner) {
|
responseCode.observe(viewLifecycleOwner) {
|
||||||
if (it.response.isNotBlank()) {
|
if (it.isNotBlank()) {
|
||||||
viewModel.getItemCard(
|
viewModel.getItemCard(
|
||||||
it.response.toLong(),
|
it.toLong(),
|
||||||
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ma.messageWithSound(
|
ma.messageWithSound(
|
||||||
getString(R.string.itemScanetNotFound),
|
getString(R.string.itemScanetNotFound),
|
||||||
true,
|
isError = true,
|
||||||
false,
|
isPlayed = false,
|
||||||
getString(R.string.noResults)
|
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 timeStamp = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
|
||||||
val fileName = "IMG_$timeStamp.jpg"
|
val fileName = "IMG_$timeStamp.jpg"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.precontrol
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
@ -63,14 +62,8 @@ class PreControladorFragment :
|
||||||
goBack = false
|
goBack = false
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//Tara 6276
|
|
||||||
/*viewModel.getSalesFromTicketOrCollection(
|
|
||||||
collectionFk = binding.scanInput.text.toString().toInt(),
|
|
||||||
print = false,
|
|
||||||
source = type
|
|
||||||
)*/
|
|
||||||
viewModel.getSales(
|
viewModel.getSales(
|
||||||
collectionFk = binding.scanInput.text.toString().toInt(),
|
collectionFk = binding.scanInput.text.toString().toInt(),
|
||||||
print = false,
|
print = false,
|
||||||
|
@ -93,13 +86,8 @@ class PreControladorFragment :
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
collectionTicketList.observe(viewLifecycleOwner, Observer {
|
||||||
|
|
||||||
if (it.isError) {
|
|
||||||
ma.messageWithSound(it.errorMessage, true, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (!goBack) navigateToCollectionList(it)
|
if (!goBack) navigateToCollectionList(it)
|
||||||
goBack = false
|
goBack = false
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -976,7 +976,7 @@ class EndSacadorFragment(
|
||||||
|
|
||||||
private fun showQuantityDialog(position: Int) {
|
private fun showQuantityDialog(position: Int) {
|
||||||
try {
|
try {
|
||||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
customDialogThreeButtons.setDescription(getString(R.string.itemSaleQuantity))
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButtonAdd(getString(R.string.Agregar)) {
|
.setOkButtonAdd(getString(R.string.Agregar)) {
|
||||||
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
||||||
|
|
|
@ -2,7 +2,6 @@ package es.verdnatura.presentation.view.feature.sacador.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
|
||||||
import android.text.InputType
|
import android.text.InputType
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
|
@ -96,13 +95,10 @@ class SacadorFragment(
|
||||||
val iconPrint = ImageView(context)
|
val iconPrint = ImageView(context)
|
||||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
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)
|
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
||||||
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
|
iconVehicleIn.tooltipText = getTooltip(R.drawable.car)
|
||||||
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
||||||
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
||||||
}
|
|
||||||
|
|
||||||
if (type == "PREPARED") {
|
if (type == "PREPARED") {
|
||||||
listIcons.add(iconVehicleIn)
|
listIcons.add(iconVehicleIn)
|
||||||
|
@ -122,7 +118,11 @@ class SacadorFragment(
|
||||||
viewModel.collection_assign(
|
viewModel.collection_assign(
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
viewModel.sectorCollectionNew(mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK))
|
viewModel.sectorCollectionNew(
|
||||||
|
mobileApplication.dataStoreApp.readDataStoreKey(
|
||||||
|
SECTORFK
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ class SacadorFragment(
|
||||||
ma.hideKeyboard(customDialogInput.getEditText())
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
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()
|
printAction()
|
||||||
|
|
||||||
|
@ -172,7 +172,9 @@ class SacadorFragment(
|
||||||
) {
|
) {
|
||||||
if (ma.havePrinter()) {
|
if (ma.havePrinter()) {
|
||||||
viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt())
|
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()
|
requireContext()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -206,7 +208,13 @@ class SacadorFragment(
|
||||||
if (!it.response.isNullOrBlank()) addCollectionToList(it.response.toInt())
|
if (!it.response.isNullOrBlank()) addCollectionToList(it.response.toInt())
|
||||||
}
|
}
|
||||||
if (it.isError) {
|
if (it.isError) {
|
||||||
ma.messageWithSound(it.errorMessage,true,true,"", isToasted = true)
|
ma.messageWithSound(
|
||||||
|
it.errorMessage,
|
||||||
|
isError = true,
|
||||||
|
isPlayed = true,
|
||||||
|
titleWithError = "",
|
||||||
|
isToasted = true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
goBack = false
|
goBack = false
|
||||||
callBack(type)
|
callBack(type)
|
||||||
|
|
|
@ -7,8 +7,6 @@ import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
|
||||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
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.CollectionVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.TicketStateList
|
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>() }
|
private val _lastTicketList by lazy { MutableLiveData<TicketStateList>() }
|
||||||
val lastTicketList: LiveData<TicketStateList> = _lastTicketList
|
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) {
|
fun getSales(collectionFk: Int, print: Boolean, source: String) {
|
||||||
|
|
||||||
salix.getSalesFromTicketOrCollection(collectionFk, print, source)
|
salix.getSalesFromTicketOrCollection(collectionFk, print, source)
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SalixCallback<CollectionVO>(context) {
|
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>) {
|
override fun onSuccess(response: Response<CollectionVO>) {
|
||||||
if (response.body() != null) {
|
|
||||||
_collectionTicketList.value = response.body()?.let { it.map(context) }
|
_collectionTicketList.value = response.body()?.let { it.map(context) }
|
||||||
} else {
|
|
||||||
_collectionTicketList.value = CollectionVO(
|
|
||||||
0,
|
|
||||||
isError = true,
|
|
||||||
errorMessage = getMessageFromAllResponse(
|
|
||||||
nameofFunction(this),
|
|
||||||
response.message()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -90,7 +38,8 @@ class ShowTicketViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
.enqueue(object : SalixCallback<List<TicketStateSalix>>(context) {
|
.enqueue(object : SalixCallback<List<TicketStateSalix>>(context) {
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun onSuccess(response: Response<List<TicketStateSalix>>) {
|
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 }) }
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.sacador.mapper
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
import es.verdnatura.presentation.common.convertToDateString
|
import es.verdnatura.presentation.common.convertToDateString
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
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.CollectionVO
|
||||||
|
@ -14,7 +15,7 @@ fun List<CollectionVO>.toDateFormat(context: Context): ArrayList<CollectionVO> {
|
||||||
collections.add(
|
collections.add(
|
||||||
CollectionVO(
|
CollectionVO(
|
||||||
collectionFk = it.collectionFk,
|
collectionFk = it.collectionFk,
|
||||||
created = getCalendarFromDate(it.created, context).convertToDateString(),
|
created = getCalendarFromDate(it.created.isoToString(), context).convertToDateString(),
|
||||||
ticketTotalCount = it.ticketTotalCount
|
ticketTotalCount = it.ticketTotalCount
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,8 +4,3 @@ class SmartTag(
|
||||||
var code: String? = "",
|
var code: String? = "",
|
||||||
var text: String? = " "
|
var text: String? = " "
|
||||||
)
|
)
|
||||||
|
|
||||||
class BufferLoad(
|
|
||||||
var code:String? = "",
|
|
||||||
var text:String? = " "
|
|
||||||
)
|
|
|
@ -34,7 +34,7 @@ class TicketAdvanceFragment(var title: String) :
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.scanInput.requestFocus()
|
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 (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||||
try {
|
try {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue