refs #6460
This commit is contained in:
parent
60e2e1e2e7
commit
bb18351550
|
@ -117,6 +117,9 @@
|
|||
</codeStyleSettings>
|
||||
<codeStyleSettings language="kotlin">
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
|
@ -127,30 +127,111 @@
|
|||
</select>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #5612">
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt" afterDir="false" />
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6460">
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragmentSalix.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/modelViewModel/FragmentsViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/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/Extensions.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/Extensions.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/ResponseItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/ResponseItemVO.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/SalixBackItems.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/common/SalixBackItems.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/testing/testPrint.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/testing/testPrint.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/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/claim/fragment/ClaimFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimFragment.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/ClaimViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/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/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/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/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/LoadUnloadFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LoadUnloadFragment.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/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/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/fragment/HistoricoArticuloViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.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/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/inventario/fragment/InventaryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/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/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/packingHolland/fragment/PackingHollandFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/packingHolland/fragment/PackingHollandFragment.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/ExpeditionPalletDetailFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanSorterViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionScanViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/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/parkingSale/fragment/ParkingSaleFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingSaleFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/parkingSale/fragment/ParkingViewModel.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/InitPreSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragmentViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/qr/QrFragmentViewModel.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/SacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/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/AutomaticAddItemFragmentTEST.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragmentTEST.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.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/res/layout/sale_row_fragment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/sale_row_fragment.xml" 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/res/layout/fragment_historico.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_historico.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_expeditiontruck_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_expeditiontruck_row.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_historico_row.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_historico_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/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -164,7 +245,7 @@
|
|||
<component name="CodeInsightWorkspaceSettings">
|
||||
<option name="optimizeImportsOnTheFly" value="true" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\sergiodt\.android\avd\Pixel_6_API_30.avd]" />
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
|
||||
<component name="ExportToHTMLSettings">
|
||||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
|
||||
|
@ -201,8 +282,8 @@
|
|||
<option value="resourceFile" />
|
||||
<option value="Class" />
|
||||
<option value="valueResourceFile" />
|
||||
<option value="Kotlin Class" />
|
||||
<option value="layoutResourceFile" />
|
||||
<option value="Kotlin Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
|
@ -256,7 +337,7 @@
|
|||
</option>
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="5802-ticketState" />
|
||||
<entry key="$PROJECT_DIR$" value="testBeta" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
|
@ -312,6 +393,7 @@
|
|||
"keyToString": {
|
||||
"ApkExportedModule": "Gestor_Almacén.app",
|
||||
"ExportApk.ApkPathForGestor_Almacén.app": "C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app",
|
||||
"KotlinFunctionFindUsagesOptions.isSearchForTextOccurrences": "true",
|
||||
"PROJECT_TRUSTED_KEY": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
|
@ -321,6 +403,7 @@
|
|||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-29/android/widget/TextView.java_SELECTED": "TextView",
|
||||
"android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-33/android/view/View.java_SELECTED": "View",
|
||||
"cidr.known.project.marker": "true",
|
||||
"com.android.tools.idea.devicemanager.tab": "Physical",
|
||||
"com.google.services.firebase.aqiPopupShown": "true",
|
||||
"git-widget-placeholder": "dev",
|
||||
"last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable",
|
||||
|
@ -328,11 +411,11 @@
|
|||
"project.structure.proportion": "0.17",
|
||||
"project.structure.side.proportion": "0.2",
|
||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||
"settings.editor.selected.configurable": "preferences.rainbow.brackets.disable.when"
|
||||
"settings.editor.selected.configurable": "preferences.sourceCode.Kotlin"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"ExportApk.BuildVariants": [
|
||||
"generalRelease"
|
||||
"betaRelease"
|
||||
]
|
||||
}
|
||||
}]]></component>
|
||||
|
@ -951,7 +1034,6 @@
|
|||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="refs #6183" />
|
||||
<MESSAGE value="refs #4815 serial" />
|
||||
<MESSAGE value="refs #6061 silex→salix" />
|
||||
<MESSAGE value="refs #5890 newSacador" />
|
||||
|
@ -976,26 +1058,12 @@
|
|||
<MESSAGE value="refs #6073 new menus" />
|
||||
<MESSAGE value="version 23.42Beta" />
|
||||
<MESSAGE value="refs #5612" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="refs #5612" />
|
||||
<MESSAGE value="refs #6460" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="refs #6460" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt</url>
|
||||
<line>546</line>
|
||||
<option name="timeStamp" value="6" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/ApiUtils.kt</url>
|
||||
<line>48</line>
|
||||
<option name="timeStamp" value="16" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt</url>
|
||||
<line>123</line>
|
||||
<option name="timeStamp" value="18" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.3.0/76f3c69879d3e01c082f49d8661c5590838148e1/retrofit-2.3.0-sources.jar!/retrofit2/Response.java</url>
|
||||
<line>29</line>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 236,
|
||||
"versionName": "23.42Beta",
|
||||
"versionCode": 238,
|
||||
"versionName": "23.48Beta",
|
||||
"outputFile": "app-beta-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -11,14 +11,22 @@ import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlV
|
|||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.itemShelvingLogViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.ItemShelvingLogViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.shelvingLogViewModel
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoViewModel
|
||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
||||
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
|
||||
import es.verdnatura.presentation.view.feature.modelViewModel.FragmentsViewModel
|
||||
import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel
|
||||
import es.verdnatura.presentation.view.feature.packingHolland.fragment.PackingHollandViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.*
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.CmrExpeditionPalletViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionPalletDetailViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionPalletViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanSorterViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionStateViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionTruckListViewModel
|
||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.PalletScanViewModel
|
||||
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingViewModel
|
||||
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
|
||||
import es.verdnatura.presentation.view.feature.photos.fragment.PhotosViewModel
|
||||
|
@ -163,7 +171,7 @@ val viewModelModule = module {
|
|||
}
|
||||
|
||||
viewModel {
|
||||
itemShelvingLogViewModel(androidContext())
|
||||
ItemShelvingLogViewModel(androidContext())
|
||||
}
|
||||
viewModel {
|
||||
shelvingLogViewModel(androidContext())
|
||||
|
@ -191,4 +199,7 @@ val viewModelModule = module {
|
|||
viewModel {
|
||||
TicketViewModel(androidContext())
|
||||
}
|
||||
viewModel {
|
||||
FragmentsViewModel(androidContext())
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ import android.graphics.Color
|
|||
import android.os.Build
|
||||
import android.text.Html
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.RequiresApi
|
||||
import java.text.SimpleDateFormat
|
||||
|
@ -13,9 +12,9 @@ import java.util.Date
|
|||
import java.util.Locale
|
||||
|
||||
|
||||
/*fun Any.toast(context: Context?, duration: Int = Toast.LENGTH_SHORT): Toast {
|
||||
return Toast.makeText(context, this.toString(), duration).apply { show() }
|
||||
}*/
|
||||
fun List<Any?>.formatWithQuotes(): String {
|
||||
return "[" + joinToString(", ") { if (it is String) "\"$it\"" else it.toString() } + "]"
|
||||
}
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
fun Any.toast(
|
||||
context: Context?,
|
||||
|
@ -30,7 +29,6 @@ fun Any.toast(
|
|||
//toast2.setGravity(Gravity.TOP, 0, 0)
|
||||
toast.show()
|
||||
return toast.apply { show() }
|
||||
|
||||
}
|
||||
|
||||
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {
|
||||
|
|
|
@ -34,9 +34,10 @@ abstract class SalixCallback<T>(val context: Context) : Callback<T> {
|
|||
onError(Error(response.message().toString()))
|
||||
}
|
||||
} else {
|
||||
|
||||
var myError = errorSalixMessage(response)
|
||||
println("ErrorSalix:$myError")
|
||||
//defaultErrorHandler(t)
|
||||
onError(Error(errorSalixMessage(response)))
|
||||
// onError(Error(response.message().toString()))
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
defaultErrorHandler(t)
|
||||
|
@ -53,6 +54,7 @@ abstract class SalixCallback<T>(val context: Context) : Callback<T> {
|
|||
}
|
||||
|
||||
private fun defaultErrorHandler(t: Throwable) {
|
||||
println("ErrorSalixx${t.message}")
|
||||
(nameofFunction((this)) + t.message).toast(context)
|
||||
//(context as MobileApplication).playSoundIsOK(false)
|
||||
}
|
||||
|
|
|
@ -7,15 +7,25 @@ import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
|||
import es.verdnatura.presentation.view.feature.ajustes.model.Train
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
|
||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.model.DeviceId
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.Expeditions
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.DeliveryInfo
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.Expedition
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
|
||||
import es.verdnatura.presentation.view.feature.login.model.DataUserSalix
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
|
||||
import es.verdnatura.presentation.view.feature.login.model.RenewToken
|
||||
|
@ -24,14 +34,21 @@ import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
|
|||
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.Supplier
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
||||
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.ItemPalletViewVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.ExpeditionMistakeSalix
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerMistakeSalix
|
||||
import okhttp3.MultipartBody
|
||||
import retrofit2.Call
|
||||
|
@ -70,13 +87,342 @@ interface SalixService {
|
|||
|
||||
@GET("AddressShortages")
|
||||
fun getAddressSalix(
|
||||
@Query("filter") filter:String
|
||||
@Query("filter") filter: String
|
||||
): Call<List<AddressLoses>>
|
||||
|
||||
@GET("Buyers")
|
||||
fun getBuyers(
|
||||
): Call<List<BuyerVO>>
|
||||
|
||||
@POST("Applications/{routine}/execute-func")
|
||||
fun executeFunc(
|
||||
@Path("routine") routine: String,
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any? = null
|
||||
): Call<Any>
|
||||
@POST("Applications/expedition_checkRoute/execute-func")
|
||||
fun expeditionCheckRoute(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<String>
|
||||
|
||||
@POST("Applications/{routine}/execute-proc")
|
||||
fun executeProc(
|
||||
@Path("routine") routine: String,
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any? = null
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/addNoteFromDelivery/execute-proc")
|
||||
fun addNote(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/item_getBalance/execute-proc")
|
||||
fun itemGetBalance(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemHistoricoVO>>
|
||||
|
||||
@POST("Applications/itemTrash/execute-proc")
|
||||
fun itemTrash(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
@POST("Applications/cmrPallet_add/execute-proc")
|
||||
fun cmrPalletAdd(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/expeditionScan_Put/execute-proc")
|
||||
fun expeditionScanPut(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/expeditionScan_List/execute-proc")
|
||||
fun expeditionScanList(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemExpeditionScanVO>>
|
||||
|
||||
@POST("Applications/expeditionScan_Add/execute-proc")
|
||||
fun expeditionScanAdd(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemScanVO>>
|
||||
|
||||
@POST("Applications/expeditionPallet_View/execute-proc")
|
||||
fun expeditionPalletView(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemPalletViewVO>>
|
||||
|
||||
@POST("Applications/expeditionPallet_List/execute-proc")
|
||||
fun expeditionPalletList(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemPalletVO>>
|
||||
|
||||
@POST("Applications/expeditionPallet_printLabel/execute-proc")
|
||||
fun expeditionPalletPrintLabel(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/expeditionLoading_add/execute-proc")
|
||||
fun expeditionLoadingAdd(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/expeditionState_addByPallet/execute-proc")
|
||||
fun expeditionStateAddByPallet(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
@POST("Applications/itemPlacementSupplyAiming/execute-proc")
|
||||
fun itemPlacementSupplyAiming(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<PlacementSupplyVO>>
|
||||
|
||||
@POST("Applications/machineWorker_getHistorical/execute-proc")
|
||||
fun machineWorkerGetHistorical(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemHistoricoVehiculo>>
|
||||
|
||||
@POST("Applications/expedition_getFromRoute/execute-proc")
|
||||
fun expeditionGetFromRoute(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ExpeditionInfoLoadUnload>>
|
||||
|
||||
@POST("Applications/company_getFiscaldata/execute-proc")
|
||||
fun companyGetFiscaldata(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<DeliveryInfo>>
|
||||
|
||||
@POST("Applications/freelance_getInfo/execute-proc")
|
||||
fun freelanceGetInfo(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<DeliveryInfo>>
|
||||
|
||||
@POST("Applications/travel_updatePacking/execute-proc")
|
||||
fun travelUpdatePacking(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/saleTracking_updateIsChecked/execute-proc")
|
||||
fun saleTrackingUpdateIsChecked(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/saleTracking_addPreparedSaleGroup/execute-proc")
|
||||
fun saleTrackingAddPreparedSaleGroup(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/setParking/execute-proc")
|
||||
fun setParking(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/sectorCollectionSaleGroup_add/execute-proc")
|
||||
fun sectorCollectionSaleGroupAdd(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/saleTracking_addPrevOK/execute-proc")
|
||||
fun saleTrackingAddPrevOK(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/machine_getWorkerPlate/execute-proc")
|
||||
fun machineGetWorkerPlate(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/sectorCollection_get/execute-proc")
|
||||
fun sectorCollectionGet(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<CollectionVO>>
|
||||
|
||||
@POST("Applications/worker_getFromHasMistake/execute-proc")
|
||||
fun workerGetFromHasMistake(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<WorkerFromMistake>>
|
||||
|
||||
@POST("Applications/sectorCollection_new/execute-proc")
|
||||
fun sectorCollectionNew(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/ticketStateToday_setState/execute-proc")
|
||||
fun ticketStateTodaySetState(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/ticket_isOutClosureZone/execute-func")
|
||||
fun ticketIsOutClosureZone(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/workerMachinery_isRegistered/execute-func")
|
||||
fun workerMachineryIsRegistered(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<String>
|
||||
|
||||
@POST("Applications/ticket_printLabelPrevious/execute-proc")
|
||||
fun ticketPrintLabelPrevious(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/deviceProductionUser_getWorker/execute-proc")
|
||||
fun deviceProductionUserGetWorker(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<JsonObject>>
|
||||
|
||||
@POST("Applications/device_checkLogin/execute-proc")
|
||||
fun deviceCheckLogin(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<LoginDevice>>
|
||||
|
||||
@POST("Applications/collection_printSticker/execute-proc")
|
||||
fun collectionStickerPrint(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelving_add/execute-proc")
|
||||
fun itemShelvingAdd(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelvingSale_Add/execute-proc")
|
||||
fun itemShelvingSaleAdd(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelving_selfConsumption/execute-proc")
|
||||
fun itemShelvingSelfConsumption(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelving_addList/execute-proc")
|
||||
fun itemShelvingAddList(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelvingTransfer/execute-proc")
|
||||
fun itemShelvingTransfer(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelving_addByClaim/execute-proc")
|
||||
fun itemShelvingAddByClaim(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/itemShelving_filterBuyer/execute-proc")
|
||||
fun itemShelvingFilterBuyer(
|
||||
@Query("params") params: Any,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<List<ItemInventaryVO>>
|
||||
|
||||
@POST("Applications/itemShelving_getSaleDate/execute-proc")
|
||||
fun itemShelvingGetSaleDate(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any,
|
||||
): Call<List<ItemShelvingSaleDate>>
|
||||
|
||||
@POST("Applications/itemShelving_add/execute-proc")
|
||||
fun itemShelvingMake(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any,
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/itemShelvingLog_get/execute-proc")
|
||||
fun itemShelvingLogGet(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any,
|
||||
): Call<List<ItemShelvingLog>>
|
||||
|
||||
@POST("Applications/itemshelving_getInfo/execute-proc")
|
||||
fun itemshelvingGetInfo(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any,
|
||||
): Call<List<ItemLocationVO>>
|
||||
|
||||
@POST("Applications/itemShelving_get/execute-proc")
|
||||
fun itemShelvingList(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any,
|
||||
): Call<List<ItemUbicadorVO>>
|
||||
|
||||
@POST("Applications/expedition_scan/execute-proc")
|
||||
fun expeditionScan(
|
||||
@Query("schema") schema: String = "srt",
|
||||
@Query("params") params: Any,
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/expedition_getState/execute-proc")
|
||||
fun expedition_getState(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any,
|
||||
): Call<ArrayList<JsonObject>>
|
||||
|
||||
@POST("Applications/item_getSimilar/execute-proc")
|
||||
fun getItemSimilar(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any
|
||||
): Call<List<ItemProposal>>
|
||||
|
||||
@POST("Applications/buy_updatePacking/execute-proc")
|
||||
fun updatePacking(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/buy_updateGrouping/execute-proc")
|
||||
fun updateGrouping(
|
||||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/buffer_setTypeByName/execute-proc")
|
||||
fun buffer_setTypeByName(
|
||||
@Query("schema") schema: String = "srt",
|
||||
@Query("params") params: Any
|
||||
): Call<List<JsonObject>>
|
||||
|
||||
@GET("collections/getCollection")
|
||||
fun getCollectionSalixLocal(
|
||||
): Call<List<CollectionTicket>>
|
||||
|
@ -133,7 +479,6 @@ interface SalixService {
|
|||
@Part file: MultipartBody.Part?, @QueryMap(encoded = true) queryMap: Map<String?, String?>
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@POST("Entries/{id}/addFromBuy")
|
||||
fun addFromBuy(
|
||||
@Path("id") id: Number,
|
||||
|
@ -141,7 +486,6 @@ interface SalixService {
|
|||
@Query("printedStickers") printedStickers: Number
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@POST("tickets/{idTicket}/transferSales") //-->saleMove en Silex
|
||||
fun transferSalesSalix(
|
||||
@Path("idTicket") idTicket: String, @Body params: listSaleSalix
|
||||
|
@ -153,7 +497,7 @@ interface SalixService {
|
|||
): Call<List<DepartmentMistake>>
|
||||
|
||||
@GET("Workers/findOne?")
|
||||
fun worker_idF11Allowed(
|
||||
fun worker_isF11Allowed(
|
||||
@Query("filter") filter: String
|
||||
): Call<JsonObject>
|
||||
|
||||
|
@ -232,7 +576,6 @@ interface SalixService {
|
|||
@Body parms: packingSiteSalix
|
||||
): Call<Unit>
|
||||
|
||||
|
||||
@PUT("ItemBarCodes")//REVISADA
|
||||
fun barcodes_edit(
|
||||
@Body params: itemBarCodeSalix
|
||||
|
@ -243,7 +586,6 @@ interface SalixService {
|
|||
@Body params: itemBarCodeSalix
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA
|
||||
fun barcodes_toitem(
|
||||
@Path("barCodeValue") barCodeValue: String
|
||||
|
@ -294,16 +636,16 @@ interface SalixService {
|
|||
@Part filePart: MultipartBody.Part,
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@PATCH("Operators/{id}")
|
||||
fun update_operator(
|
||||
@Path("id") id: Number, @Body params: Any
|
||||
@Path("id") id: Number,
|
||||
@Body params: Any
|
||||
): Call<Unit>
|
||||
|
||||
@GET("Operators/{id}")
|
||||
fun operator_getData(
|
||||
@Path("id") id: Number,
|
||||
@Query("filter") filter:String
|
||||
@Query("filter") filter: String
|
||||
): Call<OperatorSalix>
|
||||
|
||||
@GET("AccessTokenConfigs")
|
||||
|
@ -326,7 +668,6 @@ interface SalixService {
|
|||
@Body params: Any
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@POST("TicketCollections/update")
|
||||
fun ticketCollectionUpdate(
|
||||
@Query("where") filter: Any,//revisar si con Any vale, update generalmente pongo json (ejemplo: itemShelvingReset)
|
||||
|
@ -354,7 +695,6 @@ interface SalixService {
|
|||
@Body params: Any,
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@POST("ItemShelvings/getInventory")
|
||||
fun getInventoryParking(
|
||||
@Query("parkingFrom") parkingFrom: String, @Query("parkingTo") parkingTo: String
|
||||
|
@ -378,7 +718,7 @@ interface SalixService {
|
|||
|
||||
@POST("ExpeditionStates/addExpeditionState")
|
||||
fun addExpeditionState(
|
||||
@Body params: Expeditions?
|
||||
@Body params: Any
|
||||
): Call<Unit>
|
||||
|
||||
@POST("WorkerMistakes")
|
||||
|
@ -388,7 +728,7 @@ interface SalixService {
|
|||
|
||||
@GET("WorkerMistakeTypes")
|
||||
fun workerMistakesTypes(
|
||||
): Call<List<MistakeType>>
|
||||
): Call<List<MistakeType>>
|
||||
|
||||
@POST("SaleMistakes")
|
||||
fun saleMistakeAdd(
|
||||
|
@ -399,10 +739,9 @@ interface SalixService {
|
|||
fun getMistakeTypes(
|
||||
): Call<List<MistakeTypeVO>>
|
||||
|
||||
@GET("Train")
|
||||
@GET("Trains")
|
||||
fun getTrain(
|
||||
): Call<List<Train>>
|
||||
|
||||
}
|
||||
|
||||
interface SalixServiceSend {
|
||||
|
@ -412,6 +751,5 @@ interface SalixServiceSend {
|
|||
@Body params: SalixGrupo
|
||||
): Call<Boolean>
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,56 +1,33 @@
|
|||
package es.verdnatura.domain
|
||||
|
||||
import com.google.gson.JsonObject
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.Train
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||
import es.verdnatura.presentation.view.feature.collection.SalesModified
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.*
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginDevice
|
||||
import es.verdnatura.presentation.view.feature.login.model.versionApp
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.*
|
||||
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.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
||||
import retrofit2.Call
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.POST
|
||||
|
||||
|
||||
@JvmSuppressWildcards
|
||||
interface VerdnaturaService {
|
||||
|
||||
@POST("security/device_checkLogin")//REVISADA
|
||||
/* @POST("security/device_checkLogin")//REVISADA
|
||||
fun device_checkLogin(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<LoginDevice>
|
||||
Call<LoginDevice>*/
|
||||
|
||||
/*
|
||||
|
||||
@POST("almacennew/deviceLog_add")//REVISADA
|
||||
/* @POST("almacennew/deviceLog_add")//REVISADA
|
||||
fun deviceLog_add(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
*/
|
||||
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("/security/getVersion")//REVISADA
|
||||
fun getVersion(
|
||||
|
@ -61,19 +38,19 @@ interface VerdnaturaService {
|
|||
|
||||
//AJUSTES ========================================================================>
|
||||
|
||||
@POST("almacennew/printer_get")//NO SALIX
|
||||
@POST("almacennew/printer_get")//NO SALIX
|
||||
fun printer_get():
|
||||
Call<List<Printers>>
|
||||
|
||||
@POST("almacennew/train_get")//NO SALIX
|
||||
/* @POST("almacennew/train_get")//NO SALIX
|
||||
fun train_get(
|
||||
):
|
||||
Call<List<Train>>
|
||||
Call<List<Train>>*/
|
||||
|
||||
@POST("almacennew/worker_getPrinter")//NO SALIX
|
||||
/* @POST("almacennew/worker_getPrinter")//NO SALIX
|
||||
fun worker_getPrinter(
|
||||
):
|
||||
Call<List<Printers>>
|
||||
Call<List<Printers>>*/
|
||||
|
||||
@POST("almacennew/operator_updateItemPackingType")//NO SALIX
|
||||
fun operator_updateItemPackingType(
|
||||
|
@ -81,22 +58,22 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/operator_updateTrain")//NO SALIX
|
||||
/* @POST("almacennew/operator_updateTrain")//NO SALIX
|
||||
fun operator_updateTrain(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/worker_getSector")//NO SALIX
|
||||
/* @POST("almacennew/worker_getSector")//NO SALIX
|
||||
fun worker_getSector(
|
||||
):
|
||||
Call<SectorItemVO>
|
||||
Call<SectorItemVO>*/
|
||||
|
||||
@POST("almacennew/operator_getNumberOfWagons")//NO SALIX
|
||||
/* @POST("almacennew/operator_getNumberOfWagons")//NO SALIX
|
||||
fun operator_getNumberOfWagons(
|
||||
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/operator_add")//NO SALIX
|
||||
fun operator_add(
|
||||
|
@ -105,11 +82,11 @@ interface VerdnaturaService {
|
|||
|
||||
//PRESACADORES ========================================================================>
|
||||
|
||||
@POST("almacennew/ticketToPrePrepare")//NO SALIX
|
||||
/* @POST("almacennew/ticketToPrePrepare")//NO SALIX
|
||||
fun ticketToPrePrepare(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<PreSacadorItemVO>>
|
||||
Call<List<PreSacadorItemVO>>*/
|
||||
|
||||
@POST("almacennew/sectorCollection_getSale")//NO SALIX
|
||||
fun sectorCollection_getSale(
|
||||
|
@ -117,35 +94,35 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<PreSacadorItemVO>>
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyGetOrder")//NO SALIX
|
||||
/* @POST("almacennew/itemPlacementSupplyGetOrder")//NO SALIX
|
||||
fun itemPlacementSupplyGetOrder(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<PreSacadorItemVO>>
|
||||
Call<List<PreSacadorItemVO>>*/
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyCloseOrder")//NO SALIX
|
||||
/* @POST("almacennew/itemPlacementSupplyCloseOrder")//NO SALIX
|
||||
fun itemPlacementSupplyCloseOrder(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
//SACADORES / CONTROLADORES ========================================================================>
|
||||
@POST("almacennew/collectionGet") //NO SALIX
|
||||
/* @POST("almacennew/collectionGet") //NO SALIX
|
||||
fun collectionGet(
|
||||
):
|
||||
Call<List<CollectionVO>>
|
||||
Call<List<CollectionVO>>*/
|
||||
|
||||
|
||||
@POST("almacennew/sectorCollection_get") //NO SALIX
|
||||
/* @POST("almacennew/sectorCollection_get") //NO SALIX
|
||||
fun sectorCollection_get(
|
||||
):
|
||||
Call<List<CollectionVO>>
|
||||
Call<List<CollectionVO>>*/
|
||||
|
||||
@POST("almacennew/ticket_printLabelPrevious") //NO SALIX
|
||||
/* @POST("almacennew/ticket_printLabelPrevious") //NO SALIX
|
||||
fun ticket_printLabelPrevious(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/collection_assign")//NO SALIX
|
||||
fun collection_assign(
|
||||
|
@ -158,45 +135,45 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/worker_isF11Allowed")//NO SALIX
|
||||
/* @POST("almacennew/worker_isF11Allowed")//NO SALIX
|
||||
fun worker_isF11Allowed(
|
||||
):
|
||||
Call<Boolean>
|
||||
Call<Boolean>*/
|
||||
|
||||
@POST("almacennew/operator_getTrain")//NO SALIX
|
||||
/* @POST("almacennew/operator_getTrain")//NO SALIX
|
||||
fun operator_getTrain(
|
||||
):
|
||||
Call<String?>
|
||||
Call<String?>*/
|
||||
|
||||
@POST("almacennew/sectorCollection_new")//NO SALIX
|
||||
/* @POST("almacennew/sectorCollection_new")//NO SALIX
|
||||
fun sectorCollection_new(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/sectorCollectionSaleGroup_add")//NO SALIX
|
||||
/* @POST("almacennew/sectorCollectionSaleGroup_add")//NO SALIX
|
||||
fun sectorCollectionSaleGroup_add(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/saleTracking_addPrevOK")//NO SALIX
|
||||
/* @POST("almacennew/saleTracking_addPrevOK")//NO SALIX
|
||||
fun saleTracking_addPrevOK(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/saleTracking_updateIsChecked")//NO SALIX
|
||||
/* @POST("almacennew/saleTracking_updateIsChecked")//NO SALIX
|
||||
fun saleTracking_updateIsChecked(
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/ticket_isOutClosureZone")//NO SALIX
|
||||
/* @POST("almacennew/ticket_isOutClosureZone")//NO SALIX
|
||||
fun ticket_isOutClosureZone(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/collection_getUncheckedTicket")//NO SALIX
|
||||
fun collection_getUncheckedTicket(
|
||||
|
@ -223,17 +200,17 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyAiming")//REVISADA
|
||||
/* @POST("almacennew/itemPlacementSupplyAiming")//REVISADA
|
||||
fun itemPlacementSupplyAiming(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<PlacementSupplyVO>>
|
||||
Call<List<PlacementSupplyVO>>*/
|
||||
|
||||
@POST("almacennew/itemShelvingSaleSupplyAdd")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingSaleSupplyAdd")//REVISADA
|
||||
fun itemShelvingSaleSupplyAdd(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/saleTracking_mark")//REVISADA
|
||||
fun saleTracking_mark(
|
||||
|
@ -241,30 +218,30 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/collection_printSticker")//REVISADA
|
||||
/* @POST("almacennew/collection_printSticker")//REVISADA
|
||||
fun collectionStickerPrint(
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/ticketCollection_setUsedShelves")//REVISADA
|
||||
/* @POST("almacennew/ticketCollection_setUsedShelves")//REVISADA
|
||||
fun ticketCollection_setUsedShelves(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/item_updatePackingShelve")//REVISADA
|
||||
/* @POST("almacennew/item_updatePackingShelve")//REVISADA
|
||||
fun item_updatePackingShelve(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
|
||||
@POST("almacennew/saleTracking_add")//REVISADA
|
||||
/* @POST("almacennew/saleTracking_add")//REVISADA
|
||||
fun saleTracking_add(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/collectionAddItem")//REVISADA
|
||||
fun collectionAddItem(
|
||||
|
@ -284,19 +261,19 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/ticket_setState")//REVISADA
|
||||
/* @POST("almacennew/ticket_setState")//REVISADA
|
||||
fun ticket_setState(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/debug_add")//A BORRAR
|
||||
*/
|
||||
/* @POST("almacennew/debug_add")//A BORRAR
|
||||
fun debug_add(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/get_salesModifiedFromTicket")//REVISADA
|
||||
/* @POST("almacennew/get_salesModifiedFromTicket")//REVISADA
|
||||
fun get_salesModifiedFromTicket(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -305,7 +282,7 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<List<SalesModified>>
|
||||
Call<List<SalesModified>>*/
|
||||
|
||||
/* @POST("almacennew/barcodeToItem")//REVISADA
|
||||
fun getIdFromCode(
|
||||
|
@ -332,11 +309,11 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>*/
|
||||
|
||||
@GET("almacennew/itemShelving_inventory")//REVISADA
|
||||
/* @GET("almacennew/itemShelving_inventory")//REVISADA
|
||||
fun itemShelving_inventory(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
/* @POST("almacennew/mistakeType")//REVISADA
|
||||
fun mistakeType(
|
||||
|
@ -359,20 +336,20 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<DepartmentMistake>>*/
|
||||
|
||||
@POST("almacennew/worker_getFromHasMistake")//REVISADA
|
||||
/* @POST("almacennew/worker_getFromHasMistake")//REVISADA
|
||||
fun worker_getFromHasMistake(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<WorkerFromMistake>>
|
||||
Call<List<WorkerFromMistake>>*/
|
||||
|
||||
//PASILLEROS ========================================================================>
|
||||
|
||||
//CONSULTAR ARTICULO ========================================================================>
|
||||
@POST("almacennew/itemDiary")//REVISADA
|
||||
/* @POST("almacennew/itemDiary")//REVISADA
|
||||
fun itemDiary(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemHistoricoVO>>
|
||||
Call<List<ItemHistoricoVO>>*/
|
||||
|
||||
@POST("almacennew/item_card")//REVISADA
|
||||
fun getItemCard(
|
||||
|
@ -381,28 +358,28 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<ItemCardVO>
|
||||
|
||||
@POST("almacennew/item_getSimilar")//REVISADA
|
||||
/* @POST("almacennew/item_getSimilar")//REVISADA
|
||||
fun item_getSimilar(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemProposal>>
|
||||
Call<List<ItemProposal>>*/
|
||||
|
||||
@POST("almacennew/get_ItemPackingType")//A BORRAR
|
||||
/* @POST("almacennew/get_ItemPackingType")//A BORRAR
|
||||
fun getItemPackingType(
|
||||
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemPackingType>>
|
||||
Call<List<ItemPackingType>>*/
|
||||
|
||||
|
||||
@POST("almacennew/itemTrash")//REVISADA
|
||||
/* @POST("almacennew/itemTrash")//REVISADA
|
||||
fun itemTrash(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
|
||||
@POST("almacennew/buy_updateGrouping")//REVISADA
|
||||
/* @POST("almacennew/buy_updateGrouping")//REVISADA
|
||||
fun updateGrouping(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
|
@ -413,7 +390,7 @@ interface VerdnaturaService {
|
|||
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
|
||||
/* @POST("almacennew/item_saveStems")//A BORRAR
|
||||
|
@ -423,12 +400,12 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/item_saveReference")//A BORRAR
|
||||
/* @POST("almacennew/item_saveReference")//A BORRAR
|
||||
fun item_saveReference(
|
||||
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/barcodes_edit")//REVISADA
|
||||
fun barcodes_edit(
|
||||
|
@ -437,20 +414,20 @@ interface VerdnaturaService {
|
|||
Call<Any>
|
||||
|
||||
//BUSCAR ITEM ========================================================================>
|
||||
@POST("almacennew/getItemUbication")//REVISADA
|
||||
/* @POST("almacennew/getItemUbication")//REVISADA
|
||||
fun searchItemsUbicador(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemLocationVO>>
|
||||
Call<List<ItemLocationVO>>*/
|
||||
|
||||
//INVENTARIO ========================================================================>
|
||||
|
||||
|
||||
@POST("almacennew/itemShelving_filterBuyer")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_filterBuyer")//REVISADA
|
||||
fun itemShelvingRadarFilterBuyer(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemInventaryVO>>
|
||||
Call<List<ItemInventaryVO>>*/
|
||||
|
||||
//CONTROL DE VEHICULOS
|
||||
@POST("almacennew/machineWorker_add")//REVISADA
|
||||
|
@ -466,10 +443,10 @@ interface VerdnaturaService {
|
|||
Call<Any>
|
||||
|
||||
|
||||
@POST("almacennew/workerMachinery_isRegistered")//REVISADA
|
||||
/* @POST("almacennew/workerMachinery_isRegistered")//REVISADA
|
||||
fun workerMachinery_isRegistered(
|
||||
):
|
||||
Call<String>
|
||||
Call<String>*/
|
||||
|
||||
/* @POST("almacennew/deviceProduction_getnameDevice")//REVISADA
|
||||
fun deviceProduction_getnameDevice(
|
||||
|
@ -477,43 +454,43 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/deviceProductionUser_getWorker")//REVISADA
|
||||
/* @POST("almacennew/deviceProductionUser_getWorker")//REVISADA
|
||||
fun deviceProductionUser_getWorker(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<String>
|
||||
Call<String>*/
|
||||
|
||||
|
||||
@POST("almacennew/machine_getWorkerPlate")//REVISADA
|
||||
/* @POST("almacennew/machine_getWorkerPlate")//REVISADA
|
||||
fun machine_getWorkerPlate(
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/machineWorker_getHistorical")//REVISADA
|
||||
/* @POST("almacennew/machineWorker_getHistorical")//REVISADA
|
||||
fun machineWorker_getHistorical(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemHistoricoVehiculo>>
|
||||
Call<List<ItemHistoricoVehiculo>>*/
|
||||
|
||||
//UBICADOR ========================================================================>
|
||||
@POST("almacennew/itemShelvingList")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingList")//REVISADA
|
||||
fun itemShelvingList(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemUbicadorVO>>
|
||||
Call<List<ItemUbicadorVO>>*/
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingMake")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingMake")//REVISADA
|
||||
fun itemShelvingMake(
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/itemShelvingMakeEdit")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingMakeEdit")//REVISADA
|
||||
fun itemShelvingMakeEdit(
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/itemShelvingMake_multi")//REVISADA
|
||||
fun itemShelvingMake_multi(
|
||||
|
@ -521,24 +498,24 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("almacennew/itemShelving_addList")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_addList")//REVISADA
|
||||
fun itemShelving_addList(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
|
||||
@POST("almacennew/shelvingPark")//REVISADA
|
||||
/* @POST("almacennew/shelvingPark")//REVISADA
|
||||
fun shelvingPark(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/shelvingChange")//REVISADA
|
||||
/* @POST("almacennew/shelvingChange")//REVISADA
|
||||
fun shelvingChange(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/itemShelving_return")
|
||||
fun itemShelving_return(
|
||||
|
@ -547,17 +524,17 @@ interface VerdnaturaService {
|
|||
Call<ArrayList<Reubication>>
|
||||
|
||||
|
||||
@POST("almacennew/clearShelvingList")//REVISADA
|
||||
/* @POST("almacennew/clearShelvingList")//REVISADA
|
||||
fun clearShelvingList(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/itemShelvingTransfer")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingTransfer")//REVISADA
|
||||
fun itemShelvingTransfer(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/shelvingLog_add")//REVISADA
|
||||
fun shelvingLog_add(
|
||||
|
@ -565,55 +542,57 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<Any>
|
||||
|
||||
/*
|
||||
@POST("almacennew/travel_updatePacking")//REVISADA
|
||||
fun travel_updatePacking(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
*/
|
||||
|
||||
@POST("almacennew/itemShelvingDelete")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingDelete")//REVISADA
|
||||
fun itemShelvingDelete(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/itemShelving_selfConsumption")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_selfConsumption")//REVISADA
|
||||
fun itemShelving_selfConsumption(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
//BUFFER ==============================================================================>
|
||||
|
||||
@POST("almacennew/buffer_setTypeByName")//REVISADA
|
||||
/* @POST("almacennew/buffer_setTypeByName")//REVISADA
|
||||
fun buffer_setTypeByName(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Boolean>
|
||||
Call<Boolean>*/
|
||||
|
||||
// Qr reader ==========================================================================
|
||||
|
||||
@POST("almacennew/qr_getCall")//REVISADA
|
||||
/* @POST("almacennew/qr_getCall")//REVISADA
|
||||
fun qr_getCall(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
//PALETIZADORES ========================================================================>
|
||||
|
||||
@POST("almacennew/expedition_scan")//REVISADA
|
||||
/* @POST("almacennew/expedition_scan")//REVISADA
|
||||
fun expedition_scan(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/cmrPallet_add")//REVISADA
|
||||
/* @POST("almacennew/cmrPallet_add")//REVISADA
|
||||
fun cmrExpeditionPallet_add(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/expedition_getState")//REVISADA
|
||||
/* @POST("almacennew/expedition_getState")//REVISADA
|
||||
fun expedition_getState(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -622,17 +601,17 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<itemExpedetionState>
|
||||
Call<itemExpedetionState>*/
|
||||
|
||||
@POST("almacennew/expedition_getState")//REVISADA
|
||||
/* @POST("almacennew/expedition_getState")//REVISADA
|
||||
fun expedition_getStateJSON(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<JsonObject>
|
||||
Call<JsonObject>*/
|
||||
|
||||
//DIA DE VENTA
|
||||
|
||||
@POST("almacennew/itemShelving_getSaleDateOld")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_getSaleDateOld")//REVISADA
|
||||
fun itemShelving_getSaleDateOld(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -641,21 +620,21 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<JsonObject>
|
||||
Call<JsonObject>*/
|
||||
|
||||
@POST("almacennew/itemShelving_getSaleDate")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_getSaleDate")//REVISADA
|
||||
fun itemShelving_getSaleDate(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemShelvingSaleDate>>
|
||||
Call<List<ItemShelvingSaleDate>>*/
|
||||
|
||||
@POST("almacennew/itemShelvingLog_get")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingLog_get")//REVISADA
|
||||
fun itemShelvingLog_get(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemShelvingLog>>
|
||||
Call<List<ItemShelvingLog>>*/
|
||||
|
||||
@POST("almacennew/itemShelving_updateSpam")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_updateSpam")//REVISADA
|
||||
fun itemShelving_updateSpam(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -664,79 +643,79 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<Boolean>
|
||||
Call<Boolean>*/
|
||||
|
||||
|
||||
@POST("almacennew/expeditionTruckList")//REVISADA
|
||||
/* @POST("almacennew/expeditionTruckList")//REVISADA
|
||||
fun expeditionTruckList(
|
||||
):
|
||||
Call<List<ItemExpeditionTruckVO>>
|
||||
Call<List<ItemExpeditionTruckVO>>*/
|
||||
|
||||
@POST("almacennew/expeditionTruckAdd")//REVISADA
|
||||
/* @POST("almacennew/expeditionTruckAdd")//REVISADA
|
||||
fun expeditionTruckAdd(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/expeditionPalletList")//REVISADA
|
||||
/* @POST("almacennew/expeditionPalletList")//REVISADA
|
||||
fun expeditionPallet_List(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemPalletVO>>
|
||||
Call<List<ItemPalletVO>>*/
|
||||
|
||||
@POST("almacennew/expeditionScanAdd")//REVISADA
|
||||
/* @POST("almacennew/expeditionScanAdd")//REVISADA
|
||||
fun expeditionScanAdd(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemScanVO>>
|
||||
Call<List<ItemScanVO>>*/
|
||||
|
||||
@POST("almacennew/expeditionScanPut")//REVISADA
|
||||
/* @POST("almacennew/expeditionScanPut")//REVISADA
|
||||
fun expeditionScanPut(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/checkRouteExpeditionScanPut")//REVISADA
|
||||
/* @POST("almacennew/checkRouteExpeditionScanPut")//REVISADA
|
||||
fun checkRouteExpeditionScanPut(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<String>
|
||||
Call<String>*/
|
||||
|
||||
@POST("almacennew/expeditionPalletView")//REVISADA
|
||||
/* @POST("almacennew/expeditionPalletView")//REVISADA
|
||||
fun expeditionPalletView(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemPalletViewVO>>
|
||||
Call<List<ItemPalletViewVO>>*/
|
||||
|
||||
@POST("almacennew/expeditionPalletDel")//REVISADA
|
||||
/* @POST("almacennew/expeditionPalletDel")//REVISADA
|
||||
fun expeditionPalletDel(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/expeditionScanList")//REVISADA
|
||||
/* @POST("almacennew/expeditionScanList")//REVISADA
|
||||
fun expeditionScanList(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemExpeditionScanVO>>
|
||||
Call<List<ItemExpeditionScanVO>>*/
|
||||
|
||||
@POST("almacennew/expeditionScanDel")//REVISADA
|
||||
/* @POST("almacennew/expeditionScanDel")//REVISADA
|
||||
fun expeditionScanDel(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/expeditionPalletPrintSet")//REVISADA
|
||||
/* @POST("almacennew/expeditionPalletPrintSet")//REVISADA
|
||||
fun expeditionPalletPrintSet(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
@POST("almacennew/expeditionState_addByPallet")//REVISADA
|
||||
/* @POST("almacennew/expeditionState_addByPallet")//REVISADA
|
||||
fun expeditionState_addByPallet(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/expeditionPallet_get")//REVISADA
|
||||
fun expeditionPallet_get(
|
||||
|
@ -744,31 +723,31 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<ItemExpeditionTruckVO>
|
||||
|
||||
@POST("almacennew/expeditionLoading_add")//REVISADA
|
||||
/* @POST("almacennew/expeditionLoading_add")//REVISADA
|
||||
fun expeditionLoading_add(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
//CALIDAD
|
||||
@POST("almacennew/itemShelvingBuyerGet")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingBuyerGet")//REVISADA
|
||||
fun itemShelvingBuyerGet(
|
||||
):
|
||||
Call<List<BuyerVO>>
|
||||
Call<List<BuyerVO>>*/
|
||||
|
||||
|
||||
@POST("almacennew/itemShelvingStarsUpdate")//REVISADA
|
||||
/* @POST("almacennew/itemShelvingStarsUpdate")//REVISADA
|
||||
fun itemShelvingStarsUpdate(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
Call<Any>*/
|
||||
|
||||
|
||||
@POST("almacennew/itemShelving_addByClaim")//REVISADA
|
||||
/* @POST("almacennew/itemShelving_addByClaim")//REVISADA
|
||||
fun itemShelving_addByClaim(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
//SUPPLIERS
|
||||
@POST("almacennew/supplier_getItems")//REVISADA
|
||||
|
@ -777,11 +756,11 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<ItemSupplier>>
|
||||
|
||||
@POST("delivery/getInfoCompany")//NO SALIX
|
||||
/* @POST("delivery/getInfoCompany")//NO SALIX
|
||||
fun getInfoCompany(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<DeliveryInfo>>
|
||||
Call<List<DeliveryInfo>>*/
|
||||
|
||||
@POST("delivery/expedition_getLog")//NO SALIX
|
||||
fun expedition_getLog(
|
||||
|
@ -795,22 +774,22 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<RouteDelivery>>
|
||||
|
||||
@POST("delivery/expeditionState_add")//NO SALIX
|
||||
@POST("delivery/expeditionState_add")// PENDIENTE REDMINE
|
||||
fun expeditionState_add(
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("delivery/getInfoFreelance")//NO SALIX
|
||||
/*@POST("delivery/getInfoFreelance")//NO SALIX
|
||||
fun getInfoFreelance(
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<DeliveryInfo>>
|
||||
Call<List<DeliveryInfo>>*/
|
||||
|
||||
@POST("/delivery/getExpeditionFromRoute")
|
||||
/* @POST("/delivery/getExpeditionFromRoute")
|
||||
fun getExpeditionFromRoute(
|
||||
@Body vararg params: Any
|
||||
): Call<MutableList<ExpeditionInfoLoadUnload>>
|
||||
): Call<MutableList<ExpeditionInfoLoadUnload>>*/
|
||||
|
||||
@POST("/delivery/route_getExpeditionSummary")
|
||||
fun route_getExpeditionSummary(
|
||||
|
|
|
@ -33,8 +33,9 @@ import kotlin.collections.Map.*
|
|||
import kotlin.reflect.KClass
|
||||
|
||||
|
||||
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelClass: KClass<V>) :
|
||||
Fragment() {
|
||||
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
||||
viewModelClass: KClass<V>
|
||||
) : Fragment() {
|
||||
protected lateinit var mobileApplication: MobileApplication
|
||||
protected val TAG = "VERDNATURA::"
|
||||
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
||||
|
@ -75,36 +76,10 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
protected val DEPARTMENTMISTAKEID = "DEPARTMENTMISTAKEID"
|
||||
|
||||
protected val viewModel: V by viewModel(viewModelClass)
|
||||
|
||||
protected lateinit var binding: T
|
||||
|
||||
// private var isOnReadyForSpeech = false
|
||||
protected lateinit var ma: MainActivity
|
||||
|
||||
/* private var textToSpeech: TextToSpeech? = null
|
||||
private var mAudioManager: AudioManager? = null
|
||||
protected var mSpeechRecognizer: SpeechRecognizer? = null
|
||||
private var mSpeechRecognizerIntent: Intent? = null*/
|
||||
|
||||
/* protected val NEW_COLLECTION = 0
|
||||
protected val LISTO = 1
|
||||
protected val CANCEL = 2
|
||||
protected val VOLVER = 3
|
||||
protected val REPITE = 4
|
||||
protected val OTRO = 5
|
||||
protected val FALTA = 6
|
||||
protected val ERROR = -1*/
|
||||
|
||||
|
||||
/*val allowedStrings =
|
||||
Arrays.asList(
|
||||
"cero", "uno", "dos", "tres", "cuatro", "cinco", "seis", "siete",
|
||||
"ocho", "nueve", "diez", "once", "doce", "trece", "catorce",
|
||||
"quince", "dieziseis", "diezisiete", "dieziocho", "diezinueve", "veinte",
|
||||
"treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa",
|
||||
"cien", "mil"
|
||||
)*/
|
||||
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
|
||||
|
@ -121,26 +96,12 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(getLayoutId(), container, false)
|
||||
|
||||
/*sergio:deprecated. Se inicializa con onViewCreated
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
initDataBinding()
|
||||
getBundleArguments()
|
||||
observeViewModel()
|
||||
runSound()
|
||||
// requestRecordAudioPermission()
|
||||
requestRecordAudioPermissionNew()
|
||||
init()
|
||||
}*/
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initDataBinding()
|
||||
getBundleArguments()
|
||||
observeViewModel()
|
||||
//runSound()
|
||||
//requestRecordAudioPermission()
|
||||
//requestRecordAudioPermissionNew()
|
||||
|
||||
//sergio: para llamadas con SIP
|
||||
//requestCallPhonePermissionNew()
|
||||
|
@ -230,12 +191,12 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
R.drawable.ic_info_refresh -> getString(R.string.udpateRoutes)
|
||||
R.drawable.ic_info_delivery -> getString(R.string.info)
|
||||
R.drawable.ic_filter_inventory -> getString(R.string.filterNoReview)
|
||||
R.drawable.ic_remove_checks->getString(R.string.resetReviewItems)
|
||||
R.drawable.ic_remove_checks -> getString(R.string.resetReviewItems)
|
||||
R.drawable.ic_eye_inventory -> getString(R.string.inventoryShowParking)
|
||||
R.drawable.ic_sort->getString(R.string.sortRouteSalix)
|
||||
R.drawable.ic_sign_ticket->getString(R.string.signed)
|
||||
R.drawable.ic_send-> getString(R.string.sendDriverRoute)
|
||||
R.drawable.ic_remove_checks-> getString(R.string.deleteChecked)
|
||||
R.drawable.ic_sort -> getString(R.string.sortRouteSalix)
|
||||
R.drawable.ic_sign_ticket -> getString(R.string.signed)
|
||||
R.drawable.ic_send -> getString(R.string.sendDriverRoute)
|
||||
R.drawable.ic_remove_checks -> getString(R.string.deleteChecked)
|
||||
else -> {
|
||||
""
|
||||
}
|
||||
|
@ -420,7 +381,6 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
fun getWorkForm(): List<WorkForms> {
|
||||
var listForms: ArrayList<WorkForms> = ArrayList()
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_SERVER, 0)
|
||||
|
@ -481,7 +441,7 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestHome",
|
||||
"http://192.168.1.51:9000",
|
||||
"http://192.168.1.132:9000",
|
||||
urlSalix = "https://test-salix.verdnatura.es"
|
||||
)
|
||||
)
|
||||
|
@ -489,14 +449,14 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelCla
|
|||
WorkForms(
|
||||
"TestLOCAL",
|
||||
"http://10.1.4.42:9000",
|
||||
urlSalix = "http://localhost:3000"
|
||||
urlSalix = "http://10.1.4.42:3000"
|
||||
)
|
||||
)
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestLOCALHOME",
|
||||
"http://192.168.1.51:9000",
|
||||
urlSalix = "http://localhost:3000"
|
||||
"http://192.168.1.132:9000",
|
||||
urlSalix = "http://192.168.1.132:3000"
|
||||
)
|
||||
)
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,591 @@
|
|||
package es.verdnatura.presentation.base
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.room.Room
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.MobileApplication
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ToolbarFragmentBinding
|
||||
import es.verdnatura.db.DeliveryDatabase
|
||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
||||
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
|
||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import org.json.JSONObject
|
||||
import org.koin.androidx.viewmodel.ext.android.viewModel
|
||||
import java.util.*
|
||||
import kotlin.collections.Map.*
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
|
||||
abstract class BaseFragmentSalix<T : ViewDataBinding, V : BaseViewModel, W : BaseViewModel>(
|
||||
viewModelClass: KClass<V>,
|
||||
viewModelClass2: KClass<W>
|
||||
) : Fragment() {
|
||||
protected lateinit var mobileApplication: MobileApplication
|
||||
protected val TAG = "VERDNATURA::"
|
||||
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
||||
protected val PREFS_SERVER = "es.verdnatura.server.prefs"
|
||||
protected val USERFK = "userFk"
|
||||
protected val USER = "user"
|
||||
protected val PASSWORD = "password"
|
||||
protected val TOKEN = "token"
|
||||
protected val TTL = "ttl"
|
||||
protected val TOKENCREATED = "tokenCreated"
|
||||
protected val SECTORDESCRIP = "sectordescrip"
|
||||
protected val SECTORFK = "sectorFk"
|
||||
protected val NUMBEROFWAGONS = "operatorNumberOfWagons"
|
||||
protected val PRINTERNAME = "printername"
|
||||
protected val PRINTERFK = "printerFk"
|
||||
protected val WAREHOUSEFK = "warehouseFk"
|
||||
protected val REMEMBER = "recordar"
|
||||
protected val ANDROID_ID = "ANDROID_ID"
|
||||
protected val DEVICENAME = "devicename"
|
||||
protected val TRAINNAME = "trainName"
|
||||
protected val TRAINFK = "trainFk"
|
||||
protected val WORKFORMSELECTED = "workFormSelected"
|
||||
protected val SUPPLIERID = "SUPPLIERID"
|
||||
protected val ITEMPACKING = "itemPackingType"
|
||||
protected val ITEMPACKINGFK = "itemPackingTypeFk"
|
||||
protected val BUYER = "buyernickname"
|
||||
protected val BUYERID = "buyerid"
|
||||
protected val WAGON = "wagon"
|
||||
protected val TAGSTYPE = "tagstype"
|
||||
protected val WAREHOUSEFK_DEFAULT = 60
|
||||
protected val DATENOVEHICLE = "DATENOVEHICLE"
|
||||
protected val DEPARTMENTMISTAKE = "DEPARTMENTMISTAKE"
|
||||
protected val DEPARTMENTMISTAKEID = "DEPARTMENTMISTAKEID"
|
||||
|
||||
protected val viewModel: V by viewModel(viewModelClass)
|
||||
protected val viewModelSalix: W by viewModel(viewModelClass2)
|
||||
|
||||
protected lateinit var binding: T
|
||||
protected lateinit var ma: MainActivity
|
||||
protected lateinit var layoutAnimation:LinearLayout
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
|
||||
if ((requireActivity().componentName).toString().contains("MainActivity")) {
|
||||
|
||||
ma = activity as MainActivity
|
||||
}
|
||||
mobileApplication = requireActivity().application as MobileApplication
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? = inflater.inflate(getLayoutId(), container, false)
|
||||
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initDataBinding()
|
||||
observeViewModel()
|
||||
init()
|
||||
|
||||
}
|
||||
|
||||
@LayoutRes
|
||||
abstract fun getLayoutId(): Int
|
||||
open fun init() {}
|
||||
open fun observeViewModel() {
|
||||
|
||||
}
|
||||
|
||||
open fun stopAnimation(){
|
||||
if (::layoutAnimation.isInitialized)
|
||||
layoutAnimation.visibility = View.GONE
|
||||
}
|
||||
private fun initDataBinding() {
|
||||
binding = DataBindingUtil.bind<T>(requireView())!!
|
||||
|
||||
}
|
||||
|
||||
fun callBack(function:Unit, splashProgress: LinearLayout = layoutAnimation) {
|
||||
splashProgress.visibility = View.VISIBLE
|
||||
function
|
||||
stopAnimation()
|
||||
|
||||
}
|
||||
|
||||
fun textScanned_filterDouble(textScanned: String): String {
|
||||
|
||||
if (textScanned.length > 13) {
|
||||
val size = textScanned.length
|
||||
if (textScanned.substring((size / 2), size) == textScanned.substring(0, size / 2)
|
||||
) {
|
||||
return textScanned.substring(0, size / 2)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return textScanned
|
||||
|
||||
}
|
||||
|
||||
fun getTooltip(image: Int): String {
|
||||
|
||||
return when (image) {
|
||||
//itemCard
|
||||
R.drawable.ic_autorenew_black_24dp -> {
|
||||
getString(R.string.reloadItemData)
|
||||
}
|
||||
|
||||
R.drawable.ic_history_black_24dp -> getString(R.string.showHistoricalItem)
|
||||
//presacador
|
||||
R.drawable.ic_local_parking_black_24dp -> getString(R.string.allowParking)
|
||||
//collection
|
||||
R.drawable.ic_print_black_24dp -> getString(R.string.printTicket)
|
||||
R.drawable.ic_playlist_add_black_24dp -> getString(R.string.addItem)
|
||||
R.drawable.ic_worker -> getString(R.string.showFacePicker)
|
||||
R.drawable.phone_call -> getString(R.string.callPicker)
|
||||
R.drawable.car -> getString(R.string.allowSelectVehicle)
|
||||
R.drawable.car_off -> getString(R.string.allowTakeoffVehicle)
|
||||
//REPETIDO:R.drawable.ic_history_black_24dp->"Realiza llamada al sacador"
|
||||
//sacador
|
||||
R.drawable.ic_add_black_24dp -> getString(R.string.newCollection)
|
||||
//REPETIDO: R.drawable.car->"Permite coger vehículo"
|
||||
//ubicador:
|
||||
//REPETIDO: R.drawable.ic_add_black_24dp->"Genera colección para sacar"
|
||||
//REPETIDO: ic_autorenew_black_24dp
|
||||
//historico articulo
|
||||
R.drawable.ic_transaction -> getString(R.string.showFilter)
|
||||
R.drawable.alpha_f_circle_outline -> getString(R.string.showFaults)
|
||||
R.drawable.alpha_b_circle_outline -> getString(R.string.showTrash)
|
||||
|
||||
R.drawable.filter_outline -> getString(R.string.filterFlower)
|
||||
|
||||
R.drawable.ic_mode_edit_black_24dp -> getString(R.string.allowChangeShelving)
|
||||
R.drawable.ic_delete_forever_black_24dp -> getString(R.string.deleteAllitems)
|
||||
R.drawable.ic_flash_auto_black_24dp -> getString(R.string.allowAutomaticAddItem)
|
||||
R.drawable.ic_logo_salix -> getString(R.string.accessSalix)
|
||||
R.drawable.ic_eye_ui -> getString(R.string.icViewCollection)
|
||||
R.drawable.ic_collection -> getString(R.string.icViewCollection)
|
||||
R.drawable.ic_ubicator_check -> getString(R.string.checkerUbication)
|
||||
R.drawable.ic_delivery_truck -> getString(R.string.loadRoute)
|
||||
R.drawable.ic_confirm -> getString(R.string.confirmDescription)
|
||||
|
||||
R.drawable.camion -> getString(R.string.openLoadingConsignee)
|
||||
R.drawable.exit -> getString(R.string.exitScreen)
|
||||
R.drawable.ic_image_upload -> getString(R.string.messageUpload)
|
||||
|
||||
R.drawable.expedition_find -> getString(R.string.showLogExpedition)
|
||||
R.drawable.ic_info_refresh -> getString(R.string.udpateRoutes)
|
||||
R.drawable.ic_info_delivery -> getString(R.string.info)
|
||||
R.drawable.ic_filter_inventory -> getString(R.string.filterNoReview)
|
||||
R.drawable.ic_remove_checks -> getString(R.string.resetReviewItems)
|
||||
R.drawable.ic_eye_inventory -> getString(R.string.inventoryShowParking)
|
||||
R.drawable.ic_sort -> getString(R.string.sortRouteSalix)
|
||||
R.drawable.ic_sign_ticket -> getString(R.string.signed)
|
||||
R.drawable.ic_send -> getString(R.string.sendDriverRoute)
|
||||
|
||||
else -> {
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun hideBackButton(tool: ToolbarFragmentBinding) {
|
||||
tool.backButton.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
private fun getDefaults(key: String?, context: Context?): String? {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return preferences.getString(key, null)
|
||||
}
|
||||
|
||||
fun getDataInt(name: String): Int {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
return when (name) {
|
||||
SECTORFK -> prefs.getInt(name, SECTORFKDEFAULT)
|
||||
WAREHOUSEFK -> prefs.getInt(name, WAREHOUSEFKDEFAULT)
|
||||
PRINTERFK -> prefs.getInt(name, 0)
|
||||
USERFK -> prefs.getInt(USERFK, 0)
|
||||
SUPPLIERID -> prefs.getInt(SUPPLIERID, 0)
|
||||
else -> {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun getData(name: String): String {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
return when (name) {
|
||||
TOKEN -> prefs.getString(name, "").toString()
|
||||
ANDROID_ID -> prefs.getString(name, "0").toString()
|
||||
USERFK -> prefs.getString(USERFK, "").toString() //el id
|
||||
USER -> prefs.getString(USER, "").toString()
|
||||
PASSWORD -> prefs.getString(PASSWORD, "").toString()
|
||||
SECTORFK -> prefs.getInt(name, SECTORFKDEFAULT).toString()
|
||||
WAREHOUSEFK -> prefs.getInt(name, WAREHOUSEFKDEFAULT).toString()
|
||||
WAGON -> prefs.getInt(name, 2).toString()
|
||||
TAGSTYPE -> prefs.getString(name, getString(R.string.stickers)).toString()
|
||||
SECTORDESCRIP -> prefs.getString(name, getString(R.string.Sinsector)).toString()
|
||||
BUYER -> prefs.getString(name, "").toString()
|
||||
BUYERID -> prefs.getString(name, "").toString()
|
||||
DATENOVEHICLE -> prefs.getString(name, "0").toString()
|
||||
DEPARTMENTMISTAKE -> prefs.getString(name, "").toString()
|
||||
DEPARTMENTMISTAKEID -> prefs.getInt(name, 0).toString()
|
||||
PRINTERFK -> prefs.getInt(name, 0).toString()
|
||||
PRINTERNAME -> prefs.getString(name, getString(R.string.noprinter)).toString()
|
||||
NUMBEROFWAGONS -> prefs.getInt(name, 1).toString()
|
||||
TRAINFK -> prefs.getString(name, "").toString()
|
||||
TRAINNAME -> prefs.getString(name, "").toString()
|
||||
ITEMPACKING -> prefs.getString(name, "").toString()
|
||||
ITEMPACKINGFK -> prefs.getString(name, "").toString()
|
||||
WORKFORMSELECTED -> prefs.getString(name, "Producción").toString()
|
||||
"SUPPLIERNAME" -> prefs.getString(name, "").toString()
|
||||
"SUPPLIERID" -> prefs.getInt(name, 0).toString()
|
||||
"ENTRYTYPE" -> prefs.getString(name, "").toString()
|
||||
"ENTRYNUMBERIMAGES" -> prefs.getString(name, "0").toString()
|
||||
"ENTRYOBSERVATIONS" -> prefs.getString(name, "").toString()
|
||||
"SERIALNUMBER" -> prefs.getString(name, "").toString()
|
||||
|
||||
"base_url" -> {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
preferences.getString(getString(R.string.baseurl), "").toString()
|
||||
}
|
||||
|
||||
"base_urlSalix" -> {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
var serverSalix =
|
||||
preferences.getString(getString(R.string.base_urlSalix), "").toString()
|
||||
if (serverSalix.isNullOrEmpty()) {
|
||||
serverSalix = "https://salix.verdnatura.es"
|
||||
}
|
||||
return serverSalix
|
||||
}
|
||||
|
||||
else -> {
|
||||
prefs.getString(name, "").toString()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun removeSector() {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
editor.remove(SECTORFK).commit()
|
||||
editor.remove(SECTORDESCRIP).commit()
|
||||
editor.remove(WAREHOUSEFK).commit()
|
||||
|
||||
}
|
||||
|
||||
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
|
||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editor = preferences.edit()
|
||||
editor.putString(key, value)
|
||||
editor.commit()
|
||||
}
|
||||
|
||||
fun removePrinter() {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
editor.remove(PRINTERFK).commit()
|
||||
editor.remove(PRINTERNAME).commit()
|
||||
|
||||
}
|
||||
|
||||
fun saveWorkForm(workForm: WorkForms) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_SERVER, 0)
|
||||
val editor = prefs.edit()
|
||||
val gson = Gson()
|
||||
val json = gson.toJson(workForm)
|
||||
editor.putString(workForm.name, json)
|
||||
editor.commit()
|
||||
|
||||
saveData("base_url", workForm.urlSilex)
|
||||
saveData("base_urlSalix", workForm.urlSalix)
|
||||
}
|
||||
|
||||
fun deleteWorkForm(nameWorkForm: String) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_SERVER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
||||
if (nameWorkForm == "all") {
|
||||
editor.clear().apply()
|
||||
} else {
|
||||
editor.remove(nameWorkForm).commit()
|
||||
}
|
||||
}
|
||||
|
||||
fun getWorkForm(): List<WorkForms> {
|
||||
val listForms: ArrayList<WorkForms> = ArrayList()
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_SERVER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
||||
val keys: Map<String, *> = prefs.all
|
||||
for (Map in keys) {
|
||||
|
||||
|
||||
val json2 = JSONObject(Map.value.toString())
|
||||
|
||||
listForms.add(
|
||||
WorkForms(
|
||||
Map.key,
|
||||
json2.get("urlSilex").toString(),
|
||||
json2.get("urlSalix").toString(),
|
||||
json2.get("isShowDelete").toString().toBoolean(),
|
||||
json2.get("created") as Long
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
editor.commit()
|
||||
if (listForms.isEmpty()) {
|
||||
createWorksDefault()
|
||||
}
|
||||
|
||||
return listForms.sortedBy { it.created }
|
||||
}
|
||||
|
||||
fun createWorksDefault() {
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"Producción",
|
||||
"https://app.verdnatura.es",
|
||||
"https://salix.verdnatura.es"
|
||||
)
|
||||
)
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"Test",
|
||||
"https://test-app.verdnatura.es",
|
||||
urlSalix = "https://test-salix.verdnatura.es"
|
||||
)
|
||||
)
|
||||
val working_in_test = true
|
||||
if (working_in_test) {
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestLocalhost",
|
||||
"http://10.1.4.42:9000",
|
||||
urlSalix = "https://test-salix.verdnatura.es"
|
||||
)
|
||||
)
|
||||
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestHome",
|
||||
"http://192.168.1.132:9000",
|
||||
urlSalix = "https://test-salix.verdnatura.es"
|
||||
)
|
||||
)
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestLOCAL",
|
||||
"http://10.1.4.42:9000",
|
||||
urlSalix = "http://10.1.4.42:3000"
|
||||
)
|
||||
)
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"TestLOCALHOME",
|
||||
"http://192.168.1.132:9000",
|
||||
urlSalix = "http://192.168.1.132:3000"
|
||||
)
|
||||
)
|
||||
} else {
|
||||
deleteWorkForm("all")
|
||||
}
|
||||
saveWorkForm(
|
||||
WorkForms(
|
||||
"Añadir...",
|
||||
"",
|
||||
"",
|
||||
created = Calendar.getInstance().timeInMillis + Calendar.getInstance().timeInMillis
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun saveData(name: String, value: Any) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
||||
when (name) {
|
||||
|
||||
"base_url" -> {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editorPref = preferences.edit()
|
||||
editorPref.putString("base_url", value.toString())
|
||||
editorPref.commit()
|
||||
|
||||
}
|
||||
|
||||
"base_urlSalix" -> {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editorPref = preferences.edit()
|
||||
editorPref.putString("base_urlSalix", value.toString())
|
||||
editorPref.commit()
|
||||
}
|
||||
|
||||
DEPARTMENTMISTAKEID -> {
|
||||
editor.putInt(name, value as Int)
|
||||
}
|
||||
|
||||
"SUPPLIERID" -> {
|
||||
editor.putString(name, value.toString())
|
||||
}
|
||||
|
||||
else -> {
|
||||
editor.putString(name, value.toString())
|
||||
}
|
||||
|
||||
}
|
||||
editor.commit()
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun saveDataInt(name: String, value: Int) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
||||
when (name) {
|
||||
name -> editor.putInt(name, value)
|
||||
}
|
||||
editor.apply()
|
||||
|
||||
}
|
||||
|
||||
fun saveDataOperator(operator: OperatorSalix) {
|
||||
if (operator.sector == null) {
|
||||
removeSector()
|
||||
} else {
|
||||
saveDataInt(SECTORFK, operator.sector.id)
|
||||
saveData(SECTORDESCRIP, operator.sector.description)
|
||||
saveDataInt(WAREHOUSEFK, operator.sector.warehouseFk)
|
||||
}
|
||||
if (operator.printer == null) {
|
||||
removePrinter()
|
||||
} else {
|
||||
saveDataInt(PRINTERFK, operator.printer.id)
|
||||
saveData(PRINTERNAME, operator.printer.name)
|
||||
}
|
||||
if (operator.train != null) {
|
||||
saveData(TRAINNAME, operator.train.name)
|
||||
}
|
||||
saveDataInt(NUMBEROFWAGONS, operator.numberOfWagons)
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun saveDataLong(name: String, value: Long) {
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
||||
when (name) {
|
||||
name -> editor.putLong(name, value)
|
||||
}
|
||||
editor.apply()
|
||||
|
||||
}
|
||||
|
||||
fun saveWorkingForms(list: ArrayList<String>) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
editor.putString("workingForms", list.toString())
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
fun getWorkingForms(): Array<String> {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val jsonStr: String? = prefs.getString("workingForms", null)
|
||||
val gson = Gson()
|
||||
val lista: Array<String> = gson.fromJson(jsonStr, Array<String>::class.java)
|
||||
return lista
|
||||
}
|
||||
|
||||
fun saveBuyer(buyernickname: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
editor.putString(BUYER, buyernickname)
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
fun saveBuyerId(buyerid: String) {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
editor.putString(BUYERID, buyerid)
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
fun getIMEI(): String {
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val imei = prefs.getString("IMEI", "0")
|
||||
return imei.toString()
|
||||
}
|
||||
|
||||
|
||||
fun getMessageFromJSON(json: String): String {
|
||||
val gson = Gson()
|
||||
var message = ""
|
||||
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||
|
||||
val tutorialMap: Map<String, Any> =
|
||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||
tutorialMap.forEach {
|
||||
if (it.key.equals("Message")) {
|
||||
message = it.value.toString()
|
||||
}
|
||||
}
|
||||
return message
|
||||
}
|
||||
|
||||
fun getListFromJSON(json: String): List<String> {
|
||||
val gson = Gson()
|
||||
val list = mutableListOf<String>()
|
||||
|
||||
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||
|
||||
val tutorialMap: Map<String, Any> =
|
||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||
tutorialMap.forEach {
|
||||
|
||||
list.add(it.key + ":" + it.value)
|
||||
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun databaseNew(myContext: Context): DeliveryDatabase {
|
||||
|
||||
val db = Room.databaseBuilder(
|
||||
myContext,
|
||||
DeliveryDatabase::class.java, "expediciones.db"
|
||||
).build()
|
||||
return db
|
||||
}
|
|
@ -13,7 +13,6 @@ abstract class BaseViewModel : ViewModel, LifecycleObserver {
|
|||
lateinit var silex: VerdnaturaService
|
||||
lateinit var salix: SalixService
|
||||
|
||||
|
||||
constructor() : super()
|
||||
constructor(context: Context) : super() {
|
||||
app = context as MobileApplication
|
||||
|
@ -22,37 +21,23 @@ abstract class BaseViewModel : ViewModel, LifecycleObserver {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
fun nameofFunction(function: Any): String {
|
||||
// return Thread.currentThread().stackTrace[1].methodName
|
||||
try {
|
||||
return function.javaClass.enclosingMethod!!.name + "->"
|
||||
return try {
|
||||
function.javaClass.enclosingMethod!!.name + "->"
|
||||
} catch (e: Exception) {
|
||||
return "ActivityMain->"
|
||||
"ActivityMain->"
|
||||
}
|
||||
}
|
||||
|
||||
fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): String {
|
||||
fun getMessageFromAllResponse(callFunction: String, responseMessage: String): String {
|
||||
|
||||
var messageFromError: String
|
||||
val returnMessage: String
|
||||
|
||||
try {
|
||||
val answerError = JSONObject(ResponseMessage)
|
||||
messageFromError = answerError.get("Message").toString()
|
||||
var messageFromError: String = try {
|
||||
val answerError = JSONObject(responseMessage)
|
||||
answerError.get("Message").toString()
|
||||
} catch (e: Exception) {
|
||||
messageFromError = ResponseMessage
|
||||
responseMessage
|
||||
}
|
||||
|
||||
|
||||
//sergio:para personalizar los mensajes de respuesta según la llamada.
|
||||
/* when (callFunction) {
|
||||
//"collection_getTickets_" -> returnMessage ="No hay tickets para sacar. Llamada $callFunction."
|
||||
else -> {*/
|
||||
returnMessage = "Callback: $callFunction."
|
||||
// }
|
||||
// }
|
||||
|
||||
return "$messageFromError.\r$returnMessage"
|
||||
return "$messageFromError.\r${"Callback: $callFunction."}"
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,9 @@ class ResponseItemVO(
|
|||
var response: String = "",
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = "",
|
||||
var codeError: Int = 0
|
||||
var codeError: Int = 0,
|
||||
var routine: String ="",
|
||||
var data:Any? =null
|
||||
)
|
||||
|
||||
class ResponseItemNumber(
|
||||
|
|
|
@ -2,29 +2,37 @@ package es.verdnatura.presentation.common
|
|||
|
||||
|
||||
class itemBarCodeSalix(
|
||||
var itemFk: Int ,
|
||||
var code:String
|
||||
var itemFk: Int,
|
||||
var code: String
|
||||
)
|
||||
|
||||
class packingSiteSalix(
|
||||
var ticketFk:Int,
|
||||
var ticketFk: Int,
|
||||
var workerFk: Int
|
||||
|
||||
)
|
||||
|
||||
data class ItemShelvingSaleSalix(
|
||||
var id:Int,
|
||||
var quantity:Int,
|
||||
var isItemShelvingSaleEmpty:Boolean?
|
||||
var id: Int,
|
||||
var quantity: Int,
|
||||
var isItemShelvingSaleEmpty: Boolean?
|
||||
)
|
||||
|
||||
data class ItemShelvingSalix(
|
||||
var visible:Int,
|
||||
var packing:Int,
|
||||
var grouping:Int?
|
||||
var visible: Int,
|
||||
var packing: Int,
|
||||
var grouping: Int?
|
||||
|
||||
)
|
||||
|
||||
data class ItemDiscardSalixShortage(
|
||||
var itemFk :Int,
|
||||
var warehouseFk:Int,
|
||||
var quantity:Int,
|
||||
var addressFk:Int?)
|
||||
var itemFk: Int,
|
||||
var warehouseFk: Int,
|
||||
var quantity: Int,
|
||||
var addressFk: Int?
|
||||
)
|
||||
|
||||
data class BackSalixCall(
|
||||
var schema: String = "vn",
|
||||
var params: ArrayList<Any?>
|
||||
)
|
|
@ -111,9 +111,9 @@ class testPrint(
|
|||
goBack = false
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.qr_getCall(
|
||||
/* viewModel.qr_getCall(
|
||||
binding.scanInput.text.toString()
|
||||
)
|
||||
)*/
|
||||
itemscaned = binding.scanInput.text.toString()
|
||||
}
|
||||
|
||||
|
|
|
@ -435,8 +435,9 @@ class AjustesFragment :
|
|||
|
||||
viewModel.ajustesitem[3].selected = it.name
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.operator_updateTrain(
|
||||
it.id!!
|
||||
viewModel.operatorUpdateTrain(
|
||||
workerId = mobileApplication.userId!!,
|
||||
trainFk = it.id!!
|
||||
)
|
||||
ajustesAdapter!!.notifyDataSetChanged()
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.ajustes.fragment
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
|
@ -29,8 +28,6 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
|||
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingTypeList
|
||||
import es.verdnatura.presentation.view.feature.login.model.Operator
|
||||
import retrofit2.Response
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
|
||||
class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
@ -50,7 +47,6 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val actionUpdateTrain: LiveData<ResponseItemVO>
|
||||
get() = _actionUpdateTrain
|
||||
|
||||
|
||||
private val _actionUpdatePacking by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val actionUpdatePacking: LiveData<ResponseItemVO>
|
||||
get() = _actionUpdatePacking
|
||||
|
@ -59,7 +55,6 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val actionUpdatePackingTicket: LiveData<ResponseItemVO>
|
||||
get() = _actionUpdatePackingTicket
|
||||
|
||||
|
||||
private val _printerList by lazy { MutableLiveData<PrintersList>() }
|
||||
val printerList: LiveData<PrintersList>
|
||||
get() = _printerList
|
||||
|
@ -102,7 +97,6 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_isLoadingProgress.value = visibility
|
||||
}
|
||||
|
||||
|
||||
fun inititializeDefaultAjusts(
|
||||
sectorDescrip: String,
|
||||
sectorFk: Int,
|
||||
|
@ -200,7 +194,6 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
fun getItemPackingTypeSalix() {
|
||||
salix.get_ItemPackingType().enqueue(object :
|
||||
SalixCallback<List<ItemPackingType>>(context) {
|
||||
|
@ -269,16 +262,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun printer_get() {
|
||||
silex.printer_get().enqueue(object : SilexCallback<List<Printers>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
val listError: ArrayList<Printers> = ArrayList()
|
||||
listError.add(Printers(0, "", true, t.message!!))
|
||||
_printerList.value = PrintersList(listError)
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<Printers>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_printerList.value = response.body()?.let { PrintersList(it) }
|
||||
} else {
|
||||
|
@ -293,35 +277,26 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<Printers> = ArrayList()
|
||||
listError.add(Printers(0, "", true, t.message!!))
|
||||
_printerList.value = PrintersList(listError)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun train_get() {
|
||||
//Tarea 5134
|
||||
//salix.getTrain()
|
||||
silex.train_get().enqueue(object : SilexCallback<List<Train>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
salix.getTrain().enqueue(object : SilexCallback<List<Train>>(context) {
|
||||
override fun onSuccess(response: Response<List<Train>>) {
|
||||
_trainList.value = response.body()?.let { TrainList(it) }
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<Train> = ArrayList()
|
||||
listError.add(Train(0, "", true, t.message!!))
|
||||
_trainList.value = TrainList(listError)
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<Train>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_trainList.value = response.body()?.let { TrainList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<Train> = ArrayList()
|
||||
listError.add(
|
||||
Train(
|
||||
0, "", true,
|
||||
getMessageFromAllResponse(nameofFunction(this), response.message())
|
||||
)
|
||||
)
|
||||
_trainList.value = TrainList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -353,58 +328,58 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun operator_getNumberOfWagons() {
|
||||
/* fun operator_getNumberOfWagons() {
|
||||
|
||||
silex.operator_getNumberOfWagons()
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
silex.operator_getNumberOfWagons()
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_operatorGetNumberOfWagons.value = ResponseItemNumber(
|
||||
null,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
_operatorGetNumberOfWagons.value = ResponseItemNumber(
|
||||
null,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
if (response.body() != null)
|
||||
_operatorGetNumberOfWagons.value =
|
||||
ResponseItemNumber(
|
||||
if (response.body() is Number) {
|
||||
(response.body() as Double).roundToInt()
|
||||
} else {
|
||||
0
|
||||
}, isError = false
|
||||
)
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
if (response.body() != null)
|
||||
_operatorGetNumberOfWagons.value =
|
||||
ResponseItemNumber(
|
||||
if (response.body() is Number) {
|
||||
(response.body() as Double).roundToInt()
|
||||
} else {
|
||||
0
|
||||
}, isError = false
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
*/
|
||||
/* fun operator_getTrain() {
|
||||
|
||||
fun operator_getTrain() {
|
||||
silex.operator_getTrain()
|
||||
.enqueue(object : SilexCallback<String?>(context) {
|
||||
|
||||
silex.operator_getTrain()
|
||||
.enqueue(object : SilexCallback<String?>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_operatorGetTrainResponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_operatorGetTrainResponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<String?>) {
|
||||
_operatorGetTrainResponse.value =
|
||||
ResponseItemVO(
|
||||
if (response.body().toString() == "false") "" else {
|
||||
response.body().toString()
|
||||
}, false
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
override fun onSuccess(response: Response<String?>) {
|
||||
_operatorGetTrainResponse.value =
|
||||
ResponseItemVO(
|
||||
if (response.body().toString() == "false") "" else {
|
||||
response.body().toString()
|
||||
}, false
|
||||
)
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
fun operator_getItemPackingType() {
|
||||
|
||||
|
@ -431,24 +406,22 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun worker_isF11Allowed() {
|
||||
salix.worker_idF11Allowed( """{"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) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_workerAllowedResponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<JsonObject>) {
|
||||
//val isF11Allowed = (response.body())!!.get("isF11Allowed") ?: true
|
||||
_workerAllowedResponse.value = ResponseItemVO(
|
||||
response = response.body()!!.entrySet().first().value.toString(),
|
||||
isError = false,
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_workerAllowedResponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -482,21 +455,20 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun operator_updateTrain(trainFk: Int) {
|
||||
fun operatorUpdateTrain(workerId: Int, trainFk: Int) {
|
||||
ProgressLoading(VISIBLE)
|
||||
silex.operator_updateTrain(trainFk)
|
||||
.enqueue(object : SilexCallback<Unit>(context) {
|
||||
salix.update_operator(id = workerId, params = hashMapOf("trainFk" to trainFk))
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
ProgressLoading(GONE)
|
||||
super.onSuccess(response)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
ProgressLoading(GONE)
|
||||
throw t
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
ProgressLoading(GONE)
|
||||
super.onSuccess(response)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ class PrintersList(
|
|||
)
|
||||
|
||||
class Printers(
|
||||
|
||||
var id: Int,
|
||||
var name: String,
|
||||
val isError: Boolean = false,
|
||||
|
|
|
@ -48,8 +48,6 @@ class ItemCardFragment(
|
|||
private var listBarcodes: ArrayList<BarcodeVO> = ArrayList()
|
||||
private var itemsPackingType: ArrayList<ItemPackingType> = ArrayList()
|
||||
private var quantityToDiscard = 0
|
||||
|
||||
|
||||
private var itemInfoG: ItemCardVO? = null
|
||||
|
||||
companion object {
|
||||
|
@ -61,7 +59,6 @@ class ItemCardFragment(
|
|||
private lateinit var customDialogTwo: CustomDialogTwoButtons
|
||||
private lateinit var customDynamic: CustomDialogDynamicButtons
|
||||
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_item_card
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
|
@ -69,8 +66,6 @@ class ItemCardFragment(
|
|||
|
||||
binding.itemcardLayout.visibility = GONE
|
||||
ma.hideBottomNavigation(GONE)
|
||||
|
||||
setEvents()
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.titleItemConsult)
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
|
@ -81,6 +76,7 @@ class ItemCardFragment(
|
|||
getItemCard(itemFk)
|
||||
}
|
||||
setToolBar()
|
||||
setEvents()
|
||||
super.init()
|
||||
|
||||
}
|
||||
|
@ -89,7 +85,6 @@ class ItemCardFragment(
|
|||
|
||||
binding.mainToolbar.toolbarIcons.visibility = GONE
|
||||
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconReload = ImageView(context)
|
||||
iconReload.setImageResource(R.drawable.ic_autorenew_black_24dp)
|
||||
|
@ -111,7 +106,6 @@ class ItemCardFragment(
|
|||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
|
||||
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
when (item) {
|
||||
|
@ -150,17 +144,14 @@ class ItemCardFragment(
|
|||
|
||||
})
|
||||
|
||||
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun setEvents() {
|
||||
|
||||
binding.editItemFk.requestFocus()
|
||||
|
||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (binding.editItemFk.text.toString().isNotEmpty())
|
||||
|
@ -264,7 +255,6 @@ class ItemCardFragment(
|
|||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,7 +272,6 @@ class ItemCardFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun setItemCard(itemInfo: ItemCardVO) {
|
||||
itemInfoG = itemInfo
|
||||
binding.mainToolbar.toolbarTitle.text = itemInfo.id.toString() + "-" + itemInfo.longName
|
||||
|
@ -458,7 +447,6 @@ class ItemCardFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
binding.itemcardRecyclerview.adapter = adapter
|
||||
|
@ -497,47 +485,49 @@ class ItemCardFragment(
|
|||
|
||||
private fun customDialogAdd(item: ItemCardRowVO) {
|
||||
try {
|
||||
if (customDialogInput.getValue().isNotEmpty())
|
||||
editItemCardRow(
|
||||
item,
|
||||
customDialogInput.getValue().toInt()
|
||||
)
|
||||
editItemCardRow(
|
||||
item,
|
||||
customDialogInput.getValue().toInt()
|
||||
)
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.dismiss()
|
||||
ma.hideKeyboard(customDialogInput.getEditText())
|
||||
} catch (ex: Exception) {
|
||||
getString(R.string.errorInput).toast(requireContext())
|
||||
|
||||
if (item.action == "itemSaveStem"
|
||||
) {
|
||||
viewModel.item_saveStems(
|
||||
itemFk = itemInfoG!!.id,
|
||||
value = null
|
||||
)
|
||||
} else {
|
||||
getString(R.string.errorInput).toast(requireContext())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun editItemCardRow(item: ItemCardRowVO, value: Int) {
|
||||
println("item $item.action")
|
||||
when (item.action) {
|
||||
"itemStockUpdateAdd" -> {
|
||||
showProgress()
|
||||
viewModel.setVisibleDiscard(itemInfoG!!.id, warehouseFk!!, value * -1, null)
|
||||
/*viewModel.itemTrash(
|
||||
itemFk = itemInfoG!!.id,
|
||||
warehouseFk = warehouseFk!!,
|
||||
newValue = (value * -1),
|
||||
isTrash = false
|
||||
|
||||
)*/
|
||||
}
|
||||
|
||||
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item, value)
|
||||
"updateGrouping" ->
|
||||
viewModel.updateGrouping(
|
||||
warehouseFk = warehouseFk!!,
|
||||
itemFk = itemInfoG!!.id,
|
||||
value = value,
|
||||
warehouseFk = warehouseFk!!
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
"updatePacking" -> viewModel.updatePacking(
|
||||
warehouseFk = warehouseFk!!,
|
||||
itemFk = itemInfoG!!.id,
|
||||
value = value,
|
||||
warehouseFk = warehouseFk!!
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
"itemSaveStem" -> viewModel.item_saveStems(
|
||||
itemFk = itemInfoG!!.id,
|
||||
|
@ -549,10 +539,8 @@ class ItemCardFragment(
|
|||
value = value
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
if (item.action != "itemStockUpdate" && item.action != "itemStockUpdateRemove" && item.action != "itemStockUpdateAdd")
|
||||
// changeOfflineValue(item,value, listBarcodes)
|
||||
showProgress()
|
||||
}
|
||||
|
||||
|
@ -568,8 +556,6 @@ class ItemCardFragment(
|
|||
)
|
||||
}
|
||||
|
||||
//sergio: changeOffLineValue solo hace visible el progress
|
||||
|
||||
private fun showProgress() {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
}
|
||||
|
@ -577,15 +563,15 @@ class ItemCardFragment(
|
|||
private fun prepareItemStockUpdate2(itemB: ItemCardRowVO, value: Int) {
|
||||
|
||||
//Tarea 5652 , quitar código cuando está asignada tarea
|
||||
var test = true
|
||||
val test = true
|
||||
if (test) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getAddress()
|
||||
quantityToDiscard = value
|
||||
|
||||
} else {
|
||||
try {10
|
||||
value
|
||||
println("dardebaja")
|
||||
try {
|
||||
|
||||
if (itemB.action == "itemStockUpdateRemove") {
|
||||
|
||||
|
@ -599,7 +585,6 @@ class ItemCardFragment(
|
|||
isTrash = false
|
||||
|
||||
)
|
||||
//changeOfflineValue(itemB,value, listBarcodes)
|
||||
showProgress()
|
||||
customDialogTwo.dismiss()
|
||||
|
||||
|
@ -609,7 +594,6 @@ class ItemCardFragment(
|
|||
warehouseFk = warehouseFk!!,
|
||||
newValue = value,
|
||||
isTrash = true
|
||||
|
||||
)
|
||||
|
||||
showProgress()
|
||||
|
|
|
@ -5,6 +5,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -37,7 +38,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
val itemspackinglist: LiveData<ItemPackingTypeList>
|
||||
get() = _itemspackinglist
|
||||
|
||||
|
||||
private val _itemProposallist by lazy { MutableLiveData<ItemProposalList>() }
|
||||
val itemProposallist: LiveData<ItemProposalList>
|
||||
get() = _itemProposallist
|
||||
|
@ -46,14 +46,10 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
val addressLosesList: LiveData<AddressLosesList>
|
||||
get() = _addressLosesList
|
||||
|
||||
|
||||
fun getItemCard(
|
||||
|
||||
itemFk: Number,
|
||||
warehouseFk: Int,
|
||||
|
||||
) {
|
||||
println("La sale el item es $itemFk")
|
||||
) {
|
||||
silex.getItemCard(itemFk, warehouseFk)
|
||||
.enqueue(object : SilexCallback<ItemCardVO>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -63,7 +59,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!),
|
||||
stems = "", itemCost = ""
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<ItemCardVO>) {
|
||||
|
@ -87,19 +82,21 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun item_getSimilar(
|
||||
fun itemGetSimilar(
|
||||
itemFk: Int,
|
||||
warehouseFk: Int,
|
||||
vShipped: String,
|
||||
vIsShowedByType: Boolean,
|
||||
shipped: String,
|
||||
isShowedByType: Boolean,
|
||||
) {
|
||||
salix.getItemSimilar(
|
||||
params = arrayListOf(itemFk, warehouseFk, shipped, isShowedByType).formatWithQuotes()
|
||||
).enqueue(object : SalixCallback<List<ItemProposal>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemProposal>>) {
|
||||
_itemProposallist.value = response.body()?.let {
|
||||
ItemProposalList(it)
|
||||
}
|
||||
}
|
||||
|
||||
) {
|
||||
silex.item_getSimilar(
|
||||
itemFk,
|
||||
warehouseFk,
|
||||
vShipped,
|
||||
vIsShowedByType
|
||||
).enqueue(object : SilexCallback<List<ItemProposal>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemProposal> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -110,30 +107,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
_itemProposallist.value = ItemProposalList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemProposal>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_itemProposallist.value = response.body()?.let {
|
||||
ItemProposalList(it)
|
||||
}
|
||||
|
||||
} else {
|
||||
val listError: ArrayList<ItemProposal> = ArrayList()
|
||||
listError.add(
|
||||
ItemProposal(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemProposallist.value = ItemProposalList(listError)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -143,19 +116,19 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
newValue: Int,
|
||||
isTrash: Boolean
|
||||
) {
|
||||
silex.itemTrash(itemFk, warehouseFk, newValue, isTrash)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
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!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -167,7 +140,7 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
|
||||
) {
|
||||
salix.setVisibleDiscard(
|
||||
ItemDiscardSalixShortage(itemFk, warehouseFk, quantity, addressFk)
|
||||
ItemDiscardSalixShortage(itemFk, warehouseFk, quantity, addressFk)
|
||||
)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -186,12 +159,17 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun updateGrouping(
|
||||
itemFk: Int,
|
||||
value: Int,
|
||||
value: Int?,
|
||||
warehouseFk: Int
|
||||
|
||||
) {
|
||||
silex.updateGrouping(itemFk, value, warehouseFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.updateGrouping(params = arrayListOf(warehouseFk, itemFk, value))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
super.onError(t)
|
||||
_response.value = ResponseItemVO(
|
||||
|
@ -199,11 +177,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -213,8 +186,13 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
warehouseFk: Int
|
||||
|
||||
) {
|
||||
silex.updatePacking(itemFk, value, warehouseFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.updatePacking(params = arrayListOf(warehouseFk, itemFk, value))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -222,12 +200,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -244,16 +216,13 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(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))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
|
@ -274,7 +243,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
fun item_saveReference(
|
||||
itemFk: Int,
|
||||
value: Int
|
||||
|
||||
) {
|
||||
salix.updateItem(itemFk, hashMapOf("comment" to value))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
|
@ -288,7 +256,6 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(isError = false)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -316,11 +283,9 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun barcodesEditSalix(itemFk: Int, barCodeValue: String) {
|
||||
salix.barcodes_edit(
|
||||
itemBarCodeSalix(itemFk, barCodeValue)
|
||||
|
@ -337,20 +302,17 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
private val _responseinsert by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseinsert: LiveData<ResponseItemVO>
|
||||
get() = _responseinsert
|
||||
|
||||
|
||||
fun uploadPhoto(
|
||||
urlImage: String,
|
||||
itemFK: Number,
|
||||
file: File = File("$urlImage"),
|
||||
file: File = File(urlImage),
|
||||
fileRequestBody: RequestBody = RequestBody.create(MediaType.parse("image/jpeg"), file),
|
||||
filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
||||
"file",
|
||||
|
@ -373,23 +335,19 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun getAddress() {
|
||||
salix.getAddressSalix("""{ "include": [ { "relation": "address", "scope": { "fields": { "nickname": true } } } ] }""")
|
||||
.enqueue(object : SilexCallback<List<AddressLoses>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
val listError: ArrayList<AddressLoses> = ArrayList()
|
||||
listError.add(AddressLoses(isError = true, errorMessage = t.message!!))
|
||||
_addressLosesList.value = AddressLosesList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<AddressLoses>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_addressLosesList.value = response.body()?.let { AddressLosesList(it) }
|
||||
} else {
|
||||
|
@ -406,8 +364,8 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
|
|||
_addressLosesList.value = AddressLosesList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class itemGetSimilar(var a: Int, var b: Int, var c: String, var d: Boolean)
|
||||
|
|
|
@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.articulo.fragment
|
|||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.core.content.ContextCompat
|
||||
|
@ -17,17 +16,15 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
|||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.feature.articulo.adapter.ItemProposalAdapter
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
|
||||
class ItemProposalFragment(
|
||||
var itemFk: Int
|
||||
) : BaseFragment<FragmentItemproposalBinding, ItemCardViewModel>(
|
||||
ItemCardViewModel::class
|
||||
) {
|
||||
|
||||
private var adapter: ItemProposalAdapter? = null
|
||||
private var listProposal: ArrayList<ItemProposal> = ArrayList()
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
@ -46,74 +43,67 @@ class ItemProposalFragment(
|
|||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
viewModel.item_getSimilar(
|
||||
itemFk,
|
||||
getDataInt(WAREHOUSEFK),
|
||||
vShipped = currentDay(),
|
||||
vIsShowedByType = filter,
|
||||
)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
private fun currentDay(): String {
|
||||
|
||||
val calendar = Calendar.getInstance()
|
||||
val format = SimpleDateFormat(getString(R.string.dateFormat),Locale.getDefault())
|
||||
|
||||
val format = SimpleDateFormat(getString(R.string.dateFormat), Locale.getDefault())
|
||||
return format.format(calendar.time)
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
"${getString(R.string.ArticleSimilar)}:$itemFk".also { it -> it.also { binding.mainToolbar.toolbarTitle.text = it } }
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
"${getString(R.string.ArticleSimilar)}:$itemFk".also { it ->
|
||||
it.also {
|
||||
binding.mainToolbar.toolbarTitle.text = it
|
||||
}
|
||||
}
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemGetSimilar(
|
||||
itemFk,
|
||||
getDataInt(WAREHOUSEFK),
|
||||
shipped = currentDay(),
|
||||
isShowedByType = filter,
|
||||
)
|
||||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolBar() {
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconFilter=ImageView(context)
|
||||
val iconFilter = ImageView(context)
|
||||
iconFilter.setImageResource(R.drawable.filter_outline)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
iconFilter.tooltipText = getTooltip(R.drawable.filter_outline)
|
||||
|
||||
}
|
||||
resources.getDrawable(R.drawable.filter_outline, resources.newTheme())
|
||||
|
||||
listIcons.add(iconFilter)
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
when (item){
|
||||
iconFilter.drawable-> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
iconFilter.drawable.setTint(ContextCompat.getColor(
|
||||
context!!,if (filter) R.color.verdnatura_white else R.color.verdnatura_pumpkin_orange
|
||||
))
|
||||
filter = if (filter) false else true
|
||||
|
||||
viewModel.item_getSimilar(
|
||||
itemFk,
|
||||
getDataInt(WAREHOUSEFK),
|
||||
vIsShowedByType = filter,
|
||||
vShipped = currentDay(),
|
||||
)
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
when (item) {
|
||||
iconFilter.drawable -> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
iconFilter.drawable.setTint(
|
||||
ContextCompat.getColor(
|
||||
context!!,
|
||||
if (filter) R.color.verdnatura_white else R.color.verdnatura_pumpkin_orange
|
||||
)
|
||||
)
|
||||
filter = !filter
|
||||
|
||||
viewModel.itemGetSimilar(
|
||||
itemFk,
|
||||
getDataInt(WAREHOUSEFK),
|
||||
isShowedByType = filter,
|
||||
shipped = currentDay(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
|
||||
|
@ -123,29 +113,26 @@ class ItemProposalFragment(
|
|||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
itemProposallist.observe(viewLifecycleOwner, { it ->
|
||||
with(viewModel) {
|
||||
itemProposallist.observe(viewLifecycleOwner) { it ->
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
if (hideLoad) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
} else {
|
||||
hideLoad = true
|
||||
}
|
||||
|
||||
listProposal= ArrayList()
|
||||
if (!it.list.isNullOrEmpty()){
|
||||
listProposal = ArrayList()
|
||||
if (!it.list.isNullOrEmpty()) {
|
||||
it.list.forEach {
|
||||
|
||||
listProposal.add(it)
|
||||
|
||||
}}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
adapter = ItemProposalAdapter(listProposal, object : OnItemProposalClickListener {
|
||||
override fun onItemProposalClickListener(item: ItemProposal) {
|
||||
|
||||
|
@ -156,9 +143,7 @@ class ItemProposalFragment(
|
|||
layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.locationRecyclerview.layoutManager = layoutManager
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,10 @@ package es.verdnatura.presentation.view.feature.buffer.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import com.google.gson.JsonObject
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -14,20 +17,29 @@ class BufferFragmentViewModel(val context: Context) : BaseViewModel(context) {
|
|||
/* private val GetPaletizadoresUserCase: GetPaletizadoresUserCase =
|
||||
GetPaletizadoresUserCase(context)*/
|
||||
|
||||
|
||||
private val _itembuffertype by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val itembuffertype: LiveData<ResponseItemVO>
|
||||
get() = _itembuffertype
|
||||
|
||||
|
||||
private val _bufferloadresponse by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val bufferloadresponse: LiveData<ResponseItemVO>
|
||||
get() = _bufferloadresponse
|
||||
|
||||
|
||||
fun buffer_setTypeByName(vBufferFk: Int, vType: String) {
|
||||
silex.buffer_setTypeByName(vBufferFk, vType)
|
||||
.enqueue(object : SilexCallback<Boolean>(context) {
|
||||
salix.buffer_setTypeByName(params = listOf(vBufferFk, vType).formatWithQuotes())
|
||||
.enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||
override fun onSuccess(response: Response<List<JsonObject>>) {
|
||||
var responseCall = response.body()!![0].entrySet().first().value.toString()
|
||||
_itembuffertype.value = ResponseItemVO(
|
||||
isError = responseCall != "1",
|
||||
errorMessage = if (responseCall == "0") {
|
||||
context.getString(R.string.errorOperation)
|
||||
} else {
|
||||
""
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_itembuffertype.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -35,47 +47,25 @@ class BufferFragmentViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Boolean>) {
|
||||
if (response.body() == true ) {
|
||||
|
||||
_itembuffertype.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
)
|
||||
|
||||
} else {
|
||||
_itembuffertype.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionLoading_add(vExpeditionFk: Int, vBufferFk: Int) {
|
||||
silex.expeditionLoading_add(vExpeditionFk, vBufferFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
fun expeditionLoadingAdd(vExpeditionFk: Int, vBufferFk: Int) {
|
||||
salix.expeditionLoadingAdd(arrayListOf(vExpeditionFk, vBufferFk))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_bufferloadresponse.value = ResponseItemVO(
|
||||
isError = false,
|
||||
response = response.body().toString()!!
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_bufferloadresponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_bufferloadresponse.value = ResponseItemVO(
|
||||
isError = false,
|
||||
response = response.body().toString()!!
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ class BufferLoadFragment(
|
|||
|
||||
if (listTags.size==2) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.expeditionLoading_add(
|
||||
viewModel.expeditionLoadingAdd(
|
||||
vBufferFk = expeditionOrBuffer,
|
||||
vExpeditionFk = listTags.first().code.toString().toInt())
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
|||
import es.verdnatura.presentation.common.itemScanValue
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.adapter.LocationAdapter
|
||||
|
||||
|
||||
class BuscarItemFragment(
|
||||
var itemFk: Any? = null
|
||||
) : BaseFragment<FragmentBuscarItemBinding, BuscarItemViewModel>(BuscarItemViewModel::class) {
|
||||
|
@ -45,28 +44,20 @@ class BuscarItemFragment(
|
|||
super.init()
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun setEvents() {
|
||||
binding.editItemFk.requestFocus()
|
||||
binding.editItemFk.setOnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
|
||||
if (!binding.editItemFk.text.toString().isNullOrEmpty())
|
||||
//getLocations(binding.editItemFk.text.toString())
|
||||
/* #Tarea 5109*/
|
||||
|
||||
try {
|
||||
getLocations(
|
||||
itemScanValue(
|
||||
binding.editItemFk.text.toString(),
|
||||
"buy",
|
||||
"more"
|
||||
)
|
||||
if (binding.editItemFk.text.toString().isNotEmpty()) try {
|
||||
getLocations(
|
||||
itemScanValue(
|
||||
binding.editItemFk.text.toString(), "buy", "more"
|
||||
)
|
||||
} catch (Ex: Exception) {
|
||||
ma.messageWithSound(Ex.message.toString(), true, true)
|
||||
}
|
||||
)
|
||||
} catch (ex: Exception) {
|
||||
ma.messageWithSound(ex.message.toString(), true, true)
|
||||
}
|
||||
binding.editItemFk.setText("")
|
||||
ma.hideKeyboard(binding.editItemFk)
|
||||
return@setOnEditorActionListener true
|
||||
|
@ -74,7 +65,6 @@ class BuscarItemFragment(
|
|||
false
|
||||
}
|
||||
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
@ -84,7 +74,7 @@ class BuscarItemFragment(
|
|||
private fun getLocations(itemFk: Any) {
|
||||
this.itemFk = itemFk
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getLocations(itemFk)
|
||||
viewModel.itemshelvingGetInfo(itemFk)
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
@ -100,11 +90,10 @@ class BuscarItemFragment(
|
|||
|
||||
var totalVisible = 0
|
||||
it.list.forEach {
|
||||
totalVisible += it.visible
|
||||
totalVisible += it.visible
|
||||
}
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
getString(R.string.item) + itemFk + " " +getString(R.string.visibleTotal) + totalVisible
|
||||
|
||||
getString(R.string.item) + itemFk + " " + getString(R.string.visibleTotal) + totalVisible
|
||||
|
||||
}
|
||||
})
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -16,18 +16,18 @@ import retrofit2.Response
|
|||
class BuscarItemViewModel(val context: Context) : BaseViewModel(context) {
|
||||
//private val getBuscarItemUserCase: GetBuscarItemUserCase = GetBuscarItemUserCase(context)
|
||||
|
||||
|
||||
private val _locationList by lazy { MutableLiveData<LocationListVO>() }
|
||||
val locationList: LiveData<LocationListVO>
|
||||
get() = _locationList
|
||||
|
||||
|
||||
val loadLocationList = Transformations.map(_locationList) { Event(it) }
|
||||
|
||||
fun itemshelvingGetInfo(itemFk: Any) {
|
||||
salix.itemshelvingGetInfo(params = arrayListOf(itemFk))
|
||||
.enqueue(object : SalixCallback<List<ItemLocationVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
|
||||
_locationList.value = response.body()?.let { LocationListVO(it) }
|
||||
}
|
||||
|
||||
fun getLocations(itemFk: Any) {
|
||||
silex.searchItemsUbicador(itemFk)
|
||||
.enqueue(object : SilexCallback<List<ItemLocationVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemLocationVO> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -41,25 +41,6 @@ class BuscarItemViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
_locationList.value = LocationListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
|
||||
if (response.body() != null) {
|
||||
_locationList.value = response.body()?.let { LocationListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemLocationVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemLocationVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_locationList.value = LocationListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class ClaimFragment(
|
|||
private fun itemShelving_addByClaim(shelving: String) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.itemShelving_addByClaim(
|
||||
viewModel.itemShelvingAddByClaim(
|
||||
listClaims.first().code!!.toInt(),
|
||||
shelving
|
||||
)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package es.verdnatura.presentation.view.feature.claim.fragment
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -19,18 +19,9 @@ class ClaimViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseadd: LiveData<ResponseItemVO>
|
||||
get() = _responseadd
|
||||
|
||||
|
||||
fun itemShelving_addByClaim(claimFK: Int, shelvingFK: String) {
|
||||
silex.itemShelving_addByClaim(claimFK, shelvingFK)
|
||||
.enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseadd.value = ResponseItemVO(
|
||||
isError = true, errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), t.message!!
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
fun itemShelvingAddByClaim(claimFK: Int, shelvingFK: String) {
|
||||
salix.itemShelvingAddByClaim(arrayListOf(claimFK, shelvingFK).formatWithQuotes())
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_responseadd.value = ResponseItemVO(
|
||||
isError = false,
|
||||
|
@ -42,6 +33,13 @@ class ClaimViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseadd.value = ResponseItemVO(
|
||||
isError = true, errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), t.message!!
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
|
|
@ -329,8 +329,8 @@ class SaleAdapter(
|
|||
|
||||
if (sale.isParent) {
|
||||
itemArticleItemFk.visibility = View.INVISIBLE
|
||||
itemPackingText.visibility = View.INVISIBLE
|
||||
itemPackingItemFk.visibility = View.INVISIBLE
|
||||
//itemPackingText.visibility = View.INVISIBLE
|
||||
//itemPackingItemFk.visibility = View.INVISIBLE
|
||||
itemArticleCel1.visibility = View.INVISIBLE
|
||||
itemArticleCel2.visibility = View.INVISIBLE
|
||||
itemArticleCel3.visibility = View.INVISIBLE
|
||||
|
@ -344,8 +344,8 @@ class SaleAdapter(
|
|||
|
||||
} else {
|
||||
itemArticleItemFk.visibility = View.VISIBLE
|
||||
itemPackingText.visibility = View.VISIBLE
|
||||
itemPackingItemFk.visibility = View.VISIBLE
|
||||
//itemPackingText.visibility = View.VISIBLE
|
||||
//itemPackingItemFk.visibility = View.VISIBLE
|
||||
itemArticleCel1.visibility = View.VISIBLE
|
||||
itemArticleCel2.visibility = View.VISIBLE
|
||||
itemArticleCel3.visibility = View.VISIBLE
|
||||
|
|
|
@ -51,7 +51,6 @@ import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
|||
import es.verdnatura.presentation.view.feature.sacador.model.*
|
||||
import org.json.JSONObject
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class CollectionFragment(
|
||||
var collection: CollectionVO = CollectionVO(0),
|
||||
|
@ -131,7 +130,7 @@ class CollectionFragment(
|
|||
if (type.equals(CONTROLADOR)) {
|
||||
//sergio: comprueba si viene de la pantalla de controlador
|
||||
//Tarea #4280
|
||||
viewModel.ticket_isOutClosureZone(
|
||||
viewModel.ticketIsOutClosureZone(
|
||||
collection.collectionFk
|
||||
|
||||
)
|
||||
|
@ -185,7 +184,6 @@ class CollectionFragment(
|
|||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||
}
|
||||
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconPrint = ImageView(context)
|
||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||
|
@ -256,7 +254,6 @@ class CollectionFragment(
|
|||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
|
||||
private fun updateScreen() {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
|
@ -267,7 +264,6 @@ class CollectionFragment(
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
private fun markPrevia(saleGroupScanned: String): Boolean {
|
||||
|
||||
for (indice in sales.indices) {
|
||||
|
@ -276,7 +272,7 @@ class CollectionFragment(
|
|||
when (type) {
|
||||
CONTROLADOR -> markLine(indice, type)
|
||||
SACADOR -> {
|
||||
viewModel.saleTracking_add(
|
||||
viewModel.saleTrackingAddPreparedSaleGroup(
|
||||
saleGroupScanned.toInt()
|
||||
)
|
||||
return true
|
||||
|
@ -393,6 +389,7 @@ class CollectionFragment(
|
|||
findSale(binding.scanInput.text.toString())
|
||||
}
|
||||
}
|
||||
|
||||
"buy" -> binding.scanInput.setText(myQr.more)
|
||||
|
||||
}
|
||||
|
@ -439,7 +436,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showKeyboards() {
|
||||
try {
|
||||
requireActivity().showKeyboard()
|
||||
|
@ -607,12 +603,12 @@ class CollectionFragment(
|
|||
|
||||
|
||||
if (!goBack) {
|
||||
/* sendSalixMessage(
|
||||
item = dataMessageSalix.item,
|
||||
ticketFk = dataMessageSalix.ticket,
|
||||
quantity = dataMessageSalix.quantity,
|
||||
salePerson = dataMessageSalix.personSale
|
||||
)*/
|
||||
/* sendSalixMessage(
|
||||
item = dataMessageSalix.item,
|
||||
ticketFk = dataMessageSalix.ticket,
|
||||
quantity = dataMessageSalix.quantity,
|
||||
salePerson = dataMessageSalix.personSale
|
||||
)*/
|
||||
viewModel.collectionTicketGet(
|
||||
collection.collectionFk,
|
||||
getDataInt(SECTORFK),
|
||||
|
@ -712,7 +708,6 @@ class CollectionFragment(
|
|||
|
||||
responseSaleMistakeAdd.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
||||
if (!goBack) {
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
|
@ -728,18 +723,18 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
})
|
||||
/* responseSaleMove.observe(viewLifecycleOwner, Observer {
|
||||
/* responseSaleMove.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
|
||||
} else {
|
||||
if (!goBack)
|
||||
responseSaleMoveSuccesful()
|
||||
goBack = false
|
||||
}
|
||||
} else {
|
||||
if (!goBack)
|
||||
responseSaleMoveSuccesful()
|
||||
goBack = false
|
||||
}
|
||||
|
||||
})*/
|
||||
})*/
|
||||
responseGetExtensionFromUserId.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -798,7 +793,7 @@ class CollectionFragment(
|
|||
}
|
||||
customDialog.show()
|
||||
} else {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = tickets[0].toInt(),
|
||||
parking = ticketScanTxt
|
||||
)
|
||||
|
@ -832,7 +827,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* responseDel.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
@ -869,26 +863,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
/* responseItemShelvingUpdate.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//Test volver atrás
|
||||
if (!goBack){
|
||||
viewModel.saleTrackingDel(
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)}
|
||||
goBack = false
|
||||
}
|
||||
})*/
|
||||
|
||||
responseSaleReplace.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -999,7 +973,6 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
goBack = false
|
||||
}
|
||||
|
@ -1019,33 +992,30 @@ class CollectionFragment(
|
|||
goBack = false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* private fun responseSaleMoveSuccesful() {
|
||||
sales[positionCollectionSplit].quantity = quantityCollectionSplit
|
||||
/* private fun responseSaleMoveSuccesful() {
|
||||
sales[positionCollectionSplit].quantity = quantityCollectionSplit
|
||||
|
||||
if (quantityCollectionSplit == 0)
|
||||
markLine(positionCollectionSplit, type)
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
if (quantityCollectionSplit == 0)
|
||||
markLine(positionCollectionSplit, type)
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
val ticket =
|
||||
"[" + sales[positionCollectionSplit].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].ticketFk + "/summary)"
|
||||
val message =
|
||||
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket
|
||||
val ticket =
|
||||
"[" + sales[positionCollectionSplit].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].ticketFk + "/summary)"
|
||||
val message =
|
||||
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket
|
||||
|
||||
sendSalixMessageNew(message, sales[positionCollectionSplit].salePersonFk)
|
||||
sendSalixMessageNew(message, sales[positionCollectionSplit].salePersonFk)
|
||||
|
||||
}*/
|
||||
}*/
|
||||
|
||||
private fun callPicker(extensionNumber: String) {
|
||||
|
||||
|
||||
try {
|
||||
val intent = Intent(Intent.ACTION_DIAL).apply {
|
||||
data = Uri.parse("tel:$extensionNumber")
|
||||
|
@ -1056,7 +1026,6 @@ class CollectionFragment(
|
|||
// d("VERDNATURA::" + e.message)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun getSalePerson(ticketFk: Int): String {
|
||||
|
@ -1070,22 +1039,22 @@ class CollectionFragment(
|
|||
return salePerson
|
||||
}
|
||||
|
||||
/* private fun sendSalixMessage(
|
||||
item: String,
|
||||
ticketFk: Int,
|
||||
quantity: String,
|
||||
salePerson: String
|
||||
) {
|
||||
val ticket =
|
||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||
val message =
|
||||
getString(R.string.itemAdded) + item + getString(R.string.with) + quantity + getString(R.string.unityTicket) + ticket
|
||||
/* private fun sendSalixMessage(
|
||||
item: String,
|
||||
ticketFk: Int,
|
||||
quantity: String,
|
||||
salePerson: String
|
||||
) {
|
||||
val ticket =
|
||||
"[" + ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + ticketFk + "/summary)"
|
||||
val message =
|
||||
getString(R.string.itemAdded) + item + getString(R.string.with) + quantity + getString(R.string.unityTicket) + ticket
|
||||
|
||||
viewModel.sendChekingPresence(
|
||||
workerId = salePerson,
|
||||
message = message
|
||||
)
|
||||
}*/
|
||||
viewModel.sendChekingPresence(
|
||||
workerId = salePerson,
|
||||
message = message
|
||||
)
|
||||
}*/
|
||||
|
||||
//CREATE LIST
|
||||
private fun createCollectionList() {
|
||||
|
@ -1120,7 +1089,6 @@ class CollectionFragment(
|
|||
observations = observations + " " + ticket.observations
|
||||
}//}
|
||||
|
||||
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
|
@ -1186,7 +1154,7 @@ class CollectionFragment(
|
|||
},
|
||||
object : onPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
item_updatePackingShelve(sale.itemFk)
|
||||
// item_updatePackingShelve(sale.itemFk)
|
||||
}
|
||||
},
|
||||
object : OnTicketClickListener {
|
||||
|
@ -1265,7 +1233,6 @@ class CollectionFragment(
|
|||
|
||||
//SEARCH AND MARK
|
||||
|
||||
|
||||
private fun findSale(txtscan: String) {
|
||||
var index = 0
|
||||
var isBreak = false
|
||||
|
@ -1321,8 +1288,7 @@ class CollectionFragment(
|
|||
if (txtscan.contains("-")) {
|
||||
if (tickets.size > 0) {
|
||||
|
||||
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = tickets[0].toInt(),
|
||||
parking = txtscan
|
||||
)
|
||||
|
@ -1365,7 +1331,6 @@ class CollectionFragment(
|
|||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
|
||||
|
||||
if (tickets.size > 0) {
|
||||
|
||||
ticketToParking = tickets[0]
|
||||
|
@ -1402,7 +1367,7 @@ class CollectionFragment(
|
|||
|
||||
if (type.equals(CONTROLADOR)) {
|
||||
//Tarea #4280 cambiar a ticket_isOutClosureZone
|
||||
viewModel.ticket_isOutClosureZone(
|
||||
viewModel.ticketIsOutClosureZone(
|
||||
txtscan.toInt()
|
||||
|
||||
)
|
||||
|
@ -1455,7 +1420,7 @@ class CollectionFragment(
|
|||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
tickets.forEach {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = it.toInt(),
|
||||
parking = txtscan
|
||||
)
|
||||
|
@ -1540,7 +1505,6 @@ class CollectionFragment(
|
|||
s.isPreControlled = "0"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1554,7 +1518,8 @@ class CollectionFragment(
|
|||
if (type == SACADOR || getData(SECTORDESCRIP).uppercase() == getString(
|
||||
R.string.sectorALGEMESINEW
|
||||
)
|
||||
|| type == PRECHECKER) {
|
||||
|| type == PRECHECKER
|
||||
) {
|
||||
var myPosition = position
|
||||
|
||||
if (type == CONTROLADOR && getData(SECTORDESCRIP).uppercase() == getString(
|
||||
|
@ -1591,7 +1556,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1611,7 +1575,6 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
//Tarea #4371 se quita para ver si funciona correctamente
|
||||
private fun saleTracking_mark(position: Int, type: String) {
|
||||
|
||||
|
@ -1645,7 +1608,6 @@ class CollectionFragment(
|
|||
setListPosition(position, false)
|
||||
if (type != PRECHECKER) {
|
||||
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
viewModel.itemShelving_updateFromSale(
|
||||
|
@ -1660,7 +1622,6 @@ class CollectionFragment(
|
|||
"saleTracking_del"
|
||||
)*/
|
||||
|
||||
|
||||
}
|
||||
setTotalLines()
|
||||
scanRequest()
|
||||
|
@ -1825,7 +1786,6 @@ class CollectionFragment(
|
|||
).toString()
|
||||
)
|
||||
|
||||
|
||||
// Log.i("VERDNATURA:","Comprobando COGER-1")
|
||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||
try {
|
||||
|
@ -1942,7 +1902,6 @@ class CollectionFragment(
|
|||
setListPosition(storedPosition, isFromBack)
|
||||
}
|
||||
|
||||
|
||||
private fun checkItemScan(valueToCheck: String): Boolean {
|
||||
d("VERDNATURA::", "Entramos a ver el checkItem")
|
||||
if (storedPosition >= 0 && sales.size > storedPosition) {
|
||||
|
@ -1979,16 +1938,6 @@ class CollectionFragment(
|
|||
sales[storedPosition].placements[storedShelvingPosition].visible =
|
||||
"(" + (shelvingVisible.toInt() - quantity.toInt()).toString() + ")"
|
||||
}
|
||||
//Tarea #4371 se quita para ver si funciona correctamente
|
||||
/*viewModel.itemShelvingSaleSupplyAdd(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
saleFk = sales[storedPosition].saleFk,
|
||||
quantity = if (quantity != "0") quantity else customDialogList.getValue()
|
||||
|
||||
)*/
|
||||
|
||||
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
@ -2024,7 +1973,6 @@ class CollectionFragment(
|
|||
//OPTIONS
|
||||
private fun print() {
|
||||
|
||||
|
||||
if (ma.havePrinter() && ma.haveSector()) {
|
||||
showDialogLabelCount()
|
||||
|
||||
|
@ -2115,7 +2063,6 @@ class CollectionFragment(
|
|||
//hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
|
||||
|
||||
}
|
||||
false
|
||||
|
||||
|
@ -2174,7 +2121,6 @@ class CollectionFragment(
|
|||
customDialogList.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun toastDisponibility(item: ItemVO) {
|
||||
|
@ -2228,20 +2174,17 @@ class CollectionFragment(
|
|||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
// Se quita de la app
|
||||
/* if (!goBack)
|
||||
ticketCollection_setUsedShelves()
|
||||
goBack = false*/
|
||||
/* if (!goBack)
|
||||
ticketCollection_setUsedShelves()
|
||||
goBack = false*/
|
||||
|
||||
changeTicketState()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun ticketCollection_setUsedShelves() {
|
||||
|
||||
|
||||
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESI
|
||||
) && getData(SECTORDESCRIP).uppercase() != getString(
|
||||
|
@ -2250,7 +2193,6 @@ class CollectionFragment(
|
|||
))
|
||||
) {
|
||||
|
||||
|
||||
customDialogInput.setTitle(getString(R.string.shlevesNumber))
|
||||
.setDescription(getString(R.string.shlevesNumberTicket))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
|
@ -2301,14 +2243,11 @@ class CollectionFragment(
|
|||
false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun item_updatePackingShelve(itemFk: Int) {
|
||||
|
||||
/* private fun item_updatePackingShelve(itemFk: Int) {
|
||||
|
||||
isMarking = false
|
||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
||||
|
@ -2361,59 +2300,14 @@ class CollectionFragment(
|
|||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun showBottomNavigation(visibilitiy: Int) {
|
||||
//requireActivity().main_bottom_navigation.visibility = visibilitiy
|
||||
}
|
||||
}*/
|
||||
|
||||
//FALTAS / BASURA / SPLIT
|
||||
|
||||
|
||||
private fun showQuantityDialog(position: Int) {
|
||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
||||
.setValue("")
|
||||
|
||||
//Tarea4495
|
||||
// if (type != SACADOR) {
|
||||
/* customDialogThreeButtons.setOkButton(getString(R.string.titleFaults)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.titleFaults)
|
||||
)
|
||||
|
||||
}.setOkButtonTwo(getString(R.string.BasuraRechazar)) {
|
||||
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.BasuraRechazar)
|
||||
)
|
||||
}
|
||||
// }
|
||||
|
||||
customDialogThreeButtons.setOkButtonThree(getString(R.string.Reject)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Reject)
|
||||
)
|
||||
|
||||
}.setOkButtonFour(getString(R.string.Split)) {
|
||||
checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Split)
|
||||
)*/
|
||||
|
||||
|
||||
.setOkButtonAdd(getString(R.string.Agregar)) {
|
||||
/* checkAndCall(
|
||||
position,
|
||||
customDialogThreeButtons.getValue(),
|
||||
getString(R.string.Agregar)
|
||||
)*/
|
||||
increaseQuantity(position, customDialogThreeButtons.getValue().toInt())
|
||||
scanRequest()
|
||||
customDialogThreeButtons.dismiss()
|
||||
|
@ -2425,7 +2319,6 @@ class CollectionFragment(
|
|||
customDialogThreeButtons.setFocusDialogValue()
|
||||
}
|
||||
|
||||
|
||||
private fun missingTrashSuccesful() {
|
||||
|
||||
var message = ""
|
||||
|
@ -2493,11 +2386,11 @@ class CollectionFragment(
|
|||
saleAdapter?.notifyDataSetChanged()
|
||||
//enviar mensaje a salix
|
||||
|
||||
/* val ticket =
|
||||
"[" + sales[positionIncreaseQuantity].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].ticketFk + "/summary)"
|
||||
val message =
|
||||
"Se ha modificado la cantidad original " + sales[positionIncreaseQuantity].originalQuantity + " del artículo " + sales[positionIncreaseQuantity].itemFk + " a nueva cantidad: " + sales[positionIncreaseQuantity].quantity + " del ticket " + ticket
|
||||
*/
|
||||
/* val ticket =
|
||||
"[" + sales[positionIncreaseQuantity].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionIncreaseQuantity].ticketFk + "/summary)"
|
||||
val message =
|
||||
"Se ha modificado la cantidad original " + sales[positionIncreaseQuantity].originalQuantity + " del artículo " + sales[positionIncreaseQuantity].itemFk + " a nueva cantidad: " + sales[positionIncreaseQuantity].quantity + " del ticket " + ticket
|
||||
*/
|
||||
|
||||
//sergio: ahora desde encajadores
|
||||
// sendSalixMessageNew(message, sales[positionIncreaseQuantity].salePersonFk)
|
||||
|
@ -2506,16 +2399,16 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
private fun sendSalixMessageNew(message: String, workerId: String) {
|
||||
/*
|
||||
private fun sendSalixMessageNew(message: String, workerId: String) {
|
||||
|
||||
viewModel.sendChekingPresence(
|
||||
workerId = workerId,
|
||||
message = message
|
||||
viewModel.sendChekingPresence(
|
||||
workerId = workerId,
|
||||
message = message
|
||||
|
||||
)
|
||||
}
|
||||
*/
|
||||
)
|
||||
}
|
||||
*/
|
||||
|
||||
private fun increaseQuantity(position: Int, quantity: Int) {
|
||||
positionIncreaseQuantity = position
|
||||
|
@ -2526,21 +2419,20 @@ class CollectionFragment(
|
|||
quantity = quantity.toString()
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
//ESTADOS
|
||||
private fun changeTicketState() {
|
||||
if (type == CONTROLADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "CHECKED"
|
||||
)
|
||||
}
|
||||
} else if (type == SACADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "PREPARED"
|
||||
)
|
||||
|
@ -2549,7 +2441,7 @@ class CollectionFragment(
|
|||
|
||||
} else if (type == PRECHECKER) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "PREVIOUS_CONTROLLED"
|
||||
)
|
||||
|
@ -2557,7 +2449,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//OTROS
|
||||
private fun showScanner(index: Int, sale: SaleVO) {
|
||||
customDialogInput.getEditText().inputType = TYPE_CLASS_TEXT
|
||||
|
@ -2628,7 +2519,6 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun showMistakeList(list: List<MistakeTypeVO>) {
|
||||
|
@ -2687,7 +2577,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun groupSaleGroup(salesList: ArrayList<SaleVO>): MutableList<SaleVO> {
|
||||
var myMap = salesList.groupBy { it.saleGroupFk }
|
||||
var myList: MutableList<SaleVO> = mutableListOf()
|
||||
|
@ -2737,7 +2626,6 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
|||
import es.verdnatura.presentation.view.feature.sacador.model.*
|
||||
import org.json.JSONObject
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class CollectionFragmentPicker(
|
||||
var collection: CollectionVO = CollectionVO(0),
|
||||
|
@ -122,13 +121,12 @@ class CollectionFragmentPicker(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
|
||||
mperror = MediaPlayer.create((activity as MainActivity), R.raw.error)
|
||||
mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok)
|
||||
if (type.equals(CONTROLADOR)) {
|
||||
//sergio: comprueba si viene de la pantalla de controlador
|
||||
//Tarea #4280
|
||||
viewModel.ticket_isOutClosureZone(
|
||||
viewModel.ticketIsOutClosureZone(
|
||||
collection.collectionFk
|
||||
|
||||
)
|
||||
|
@ -183,7 +181,6 @@ class CollectionFragmentPicker(
|
|||
binding.mainToolbar.toolbarTitle.text = collection.collectionFk.toString()
|
||||
}
|
||||
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconPrint = ImageView(context)
|
||||
iconPrint.setImageResource(R.drawable.ic_print_black_24dp)
|
||||
|
@ -254,7 +251,6 @@ class CollectionFragmentPicker(
|
|||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
|
||||
private fun updateScreen() {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
|
@ -265,7 +261,6 @@ class CollectionFragmentPicker(
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
private fun markPrevia(saleGroupScanned: String): Boolean {
|
||||
|
||||
for (indice in sales.indices) {
|
||||
|
@ -274,7 +269,7 @@ class CollectionFragmentPicker(
|
|||
when (type) {
|
||||
CONTROLADOR -> markLine(indice, type)
|
||||
SACADOR -> {
|
||||
viewModel.saleTracking_add(
|
||||
viewModel.saleTrackingAddPreparedSaleGroup(
|
||||
saleGroupScanned.toInt()
|
||||
)
|
||||
return true
|
||||
|
@ -438,7 +433,6 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showKeyboards() {
|
||||
try {
|
||||
requireActivity().showKeyboard()
|
||||
|
@ -711,7 +705,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
responseSaleMistakeAdd.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
||||
if (!goBack) {
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
|
@ -797,7 +790,7 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
customDialog.show()
|
||||
} else {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = tickets[0].toInt(),
|
||||
parking = ticketScanTxt
|
||||
)
|
||||
|
@ -831,7 +824,6 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* responseDel.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
@ -998,7 +990,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
goBack = false
|
||||
}
|
||||
|
@ -1018,11 +1009,9 @@ class CollectionFragmentPicker(
|
|||
goBack = false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1044,7 +1033,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
private fun callPicker(extensionNumber: String) {
|
||||
|
||||
|
||||
try {
|
||||
val intent = Intent(Intent.ACTION_DIAL).apply {
|
||||
data = Uri.parse("tel:$extensionNumber")
|
||||
|
@ -1055,7 +1043,6 @@ class CollectionFragmentPicker(
|
|||
// d("VERDNATURA::" + e.message)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun getSalePerson(ticketFk: Int): String {
|
||||
|
@ -1120,7 +1107,6 @@ class CollectionFragmentPicker(
|
|||
observations = observations + " " + ticket.observations
|
||||
}//}
|
||||
|
||||
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
|
@ -1186,7 +1172,7 @@ class CollectionFragmentPicker(
|
|||
},
|
||||
object : onPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
item_updatePackingShelve(sale.itemFk)
|
||||
// item_updatePackingShelve(sale.itemFk)
|
||||
}
|
||||
},
|
||||
object : OnTicketClickListener {
|
||||
|
@ -1269,7 +1255,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
//SEARCH AND MARK
|
||||
|
||||
|
||||
private fun findSale(txtscan: String) {
|
||||
var index = 0
|
||||
var isBreak = false
|
||||
|
@ -1337,8 +1322,7 @@ class CollectionFragmentPicker(
|
|||
if (txtscan.contains("-")) {
|
||||
if (tickets.size > 0) {
|
||||
|
||||
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = tickets[0].toInt(),
|
||||
parking = txtscan
|
||||
)
|
||||
|
@ -1381,7 +1365,6 @@ class CollectionFragmentPicker(
|
|||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
|
||||
|
||||
if (tickets.size > 0) {
|
||||
|
||||
ticketToParking = tickets[0]
|
||||
|
@ -1418,7 +1401,7 @@ class CollectionFragmentPicker(
|
|||
|
||||
if (type.equals(CONTROLADOR)) {
|
||||
//Tarea #4280 cambiar a ticket_isOutClosureZone
|
||||
viewModel.ticket_isOutClosureZone(
|
||||
viewModel.ticketIsOutClosureZone(
|
||||
txtscan.toInt()
|
||||
|
||||
)
|
||||
|
@ -1469,7 +1452,7 @@ class CollectionFragmentPicker(
|
|||
private fun checkIsParking(txtscan: String) {
|
||||
if (txtscan.contains("-")) {
|
||||
tickets.forEach {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = it.toInt(),
|
||||
parking = txtscan
|
||||
)
|
||||
|
@ -1561,7 +1544,6 @@ class CollectionFragmentPicker(
|
|||
s.isPreControlled = "0"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1636,7 +1618,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
}
|
||||
|
||||
|
||||
//Tarea #4371 se quita para ver si funciona correctamente
|
||||
private fun saleTracking_mark(position: Int, type: String) {
|
||||
|
||||
|
@ -1677,16 +1658,14 @@ class CollectionFragmentPicker(
|
|||
for (indice in myGroupList.indices) {
|
||||
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
||||
storedBackPosition = indice
|
||||
// setListPosition(storedBackPosition,false)
|
||||
|
||||
}
|
||||
}
|
||||
storedBackPosition = position
|
||||
setListPosition(position, false)
|
||||
if (type != PRECHECKER) {
|
||||
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
viewModel.itemShelving_updateFromSale(
|
||||
|
@ -1701,7 +1680,6 @@ class CollectionFragmentPicker(
|
|||
"saleTracking_del"
|
||||
)*/
|
||||
|
||||
|
||||
}
|
||||
setTotalLines()
|
||||
scanRequest()
|
||||
|
@ -1725,7 +1703,6 @@ class CollectionFragmentPicker(
|
|||
(sales[position].quantity!! - sales[position].pickedQuantity!!.toInt())
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
//Log.i("VERDNATURA:","Aparece para enviar")
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
itemFk = sales[position].itemFk,
|
||||
quantity = quantityGet,
|
||||
|
@ -1872,7 +1849,6 @@ class CollectionFragmentPicker(
|
|||
).toString()
|
||||
)
|
||||
|
||||
|
||||
// Log.i("VERDNATURA:","Comprobando COGER-1")
|
||||
if (customDialogList.getValueTwo().isNotEmpty()) {
|
||||
try {
|
||||
|
@ -1993,9 +1969,8 @@ class CollectionFragmentPicker(
|
|||
setListPosition(storedPosition, isFromBack)
|
||||
}
|
||||
|
||||
|
||||
private fun checkItemScan(valueToCheck: String): Boolean {
|
||||
Log.d("VERDNATURA::", "Entramos a ver el checkItem")
|
||||
|
||||
if (storedPosition >= 0 && sales.size > storedPosition) {
|
||||
val saleToCheck = sales[storedPosition]
|
||||
|
||||
|
@ -2030,16 +2005,6 @@ class CollectionFragmentPicker(
|
|||
sales[storedPosition].placements[storedShelvingPosition].visible =
|
||||
"(" + (shelvingVisible.toInt() - quantity.toInt()).toString() + ")"
|
||||
}
|
||||
//Tarea #4371 se quita para ver si funciona correctamente
|
||||
/*viewModel.itemShelvingSaleSupplyAdd(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
saleFk = sales[storedPosition].saleFk,
|
||||
quantity = if (quantity != "0") quantity else customDialogList.getValue()
|
||||
|
||||
)*/
|
||||
|
||||
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
@ -2075,7 +2040,6 @@ class CollectionFragmentPicker(
|
|||
//OPTIONS
|
||||
private fun print() {
|
||||
|
||||
|
||||
if (ma.havePrinter() && ma.haveSector()) {
|
||||
showDialogLabelCount()
|
||||
|
||||
|
@ -2166,7 +2130,6 @@ class CollectionFragmentPicker(
|
|||
//hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
|
||||
|
||||
}
|
||||
false
|
||||
|
||||
|
@ -2225,7 +2188,6 @@ class CollectionFragmentPicker(
|
|||
customDialogList.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* private fun showDisponibility() {
|
||||
|
@ -2338,14 +2300,11 @@ class CollectionFragmentPicker(
|
|||
|
||||
changeTicketState()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun ticketCollection_setUsedShelves() {
|
||||
|
||||
|
||||
if (type.equals("CHECKER") && (isMarking && (getData(SECTORDESCRIP).uppercase() != getString(
|
||||
R.string.sectorALGEMESI
|
||||
) && getData(SECTORDESCRIP).uppercase() != getString(
|
||||
|
@ -2354,7 +2313,6 @@ class CollectionFragmentPicker(
|
|||
))
|
||||
) {
|
||||
|
||||
|
||||
customDialogInput.setTitle(getString(R.string.shlevesNumber))
|
||||
.setDescription(getString(R.string.shlevesNumberTicket))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
|
@ -2405,64 +2363,6 @@ class CollectionFragmentPicker(
|
|||
false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun item_updatePackingShelve(itemFk: Int) {
|
||||
|
||||
|
||||
isMarking = false
|
||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
||||
.setDescription(getString(R.string.packetIndicate))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue().toInt()
|
||||
)
|
||||
hideKeyboards()
|
||||
//showKeyboards()
|
||||
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.dismiss()
|
||||
// hideKeyboards()
|
||||
showKeyboards()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
|
||||
customDialogInput.dismiss()
|
||||
//hideKeyboards()
|
||||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue().toInt()
|
||||
)
|
||||
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2473,7 +2373,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
//FALTAS / BASURA / SPLIT
|
||||
|
||||
|
||||
private fun showQuantityDialog(position: Int) {
|
||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
||||
.setValue("")
|
||||
|
@ -2596,21 +2495,20 @@ class CollectionFragmentPicker(
|
|||
quantity = quantity.toString()
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
//ESTADOS
|
||||
private fun changeTicketState() {
|
||||
if (type == CONTROLADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "CHECKED"
|
||||
)
|
||||
}
|
||||
} else if (type == SACADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "PREPARED"
|
||||
)
|
||||
|
@ -2619,7 +2517,7 @@ class CollectionFragmentPicker(
|
|||
|
||||
} else if (type == PRECHECKER) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "PREVIOUS_CONTROLLED"
|
||||
)
|
||||
|
@ -2627,7 +2525,6 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//OTROS
|
||||
private fun showScanner(index: Int, sale: SaleVO) {
|
||||
customDialogInput.getEditText().inputType = InputType.TYPE_CLASS_TEXT
|
||||
|
@ -2711,7 +2608,6 @@ class CollectionFragmentPicker(
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun showMistakeList(list: List<MistakeTypeVO>) {
|
||||
|
@ -2770,7 +2666,6 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun groupSaleGroup(salesList: ArrayList<SaleVO>): MutableList<SaleVO> {
|
||||
var myMap = salesList.groupBy { it.saleGroupFk }
|
||||
var myList: MutableList<SaleVO> = mutableListOf()
|
||||
|
@ -2820,7 +2715,6 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -131,7 +131,7 @@ class CollectionFragmentPreChecker(
|
|||
if (type.equals(CONTROLADOR)) {
|
||||
//sergio: comprueba si viene de la pantalla de controlador
|
||||
//Tarea #4280
|
||||
viewModel.ticket_isOutClosureZone(
|
||||
viewModel.ticketIsOutClosureZone(
|
||||
collection.collectionFk
|
||||
|
||||
)
|
||||
|
@ -276,7 +276,7 @@ class CollectionFragmentPreChecker(
|
|||
when (type) {
|
||||
CONTROLADOR -> markLine(indice, type)
|
||||
SACADOR -> {
|
||||
viewModel.saleTracking_add(
|
||||
viewModel.saleTrackingAddPreparedSaleGroup(
|
||||
saleGroupScanned.toInt()
|
||||
)
|
||||
return true
|
||||
|
@ -402,7 +402,7 @@ class CollectionFragmentPreChecker(
|
|||
var saleGroup = ""
|
||||
it.sales.forEach { at ->
|
||||
if (at.saleGroupFk != saleGroup) {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = at.saleGroupFk.toInt(),
|
||||
parking = myQr.more!!
|
||||
)
|
||||
|
@ -818,7 +818,7 @@ class CollectionFragmentPreChecker(
|
|||
}
|
||||
customDialog.show()
|
||||
} else {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = tickets[0].toInt(),
|
||||
parking = ticketScanTxt
|
||||
)
|
||||
|
@ -889,26 +889,6 @@ class CollectionFragmentPreChecker(
|
|||
}
|
||||
}
|
||||
|
||||
/* responseItemShelvingUpdate.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//Test volver atrás
|
||||
if (!goBack){
|
||||
viewModel.saleTrackingDel(
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)}
|
||||
goBack = false
|
||||
}
|
||||
})*/
|
||||
|
||||
responseSaleReplace.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -1209,7 +1189,7 @@ class CollectionFragmentPreChecker(
|
|||
},
|
||||
object : onPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
item_updatePackingShelve(sale.itemFk)
|
||||
//item_updatePackingShelve(sale.itemFk)
|
||||
}
|
||||
},
|
||||
object : OnTicketClickListener {
|
||||
|
@ -1346,7 +1326,7 @@ class CollectionFragmentPreChecker(
|
|||
if (tickets.size > 0) {
|
||||
|
||||
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = tickets[0].toInt(),
|
||||
parking = txtscan
|
||||
)
|
||||
|
@ -1426,7 +1406,7 @@ class CollectionFragmentPreChecker(
|
|||
|
||||
if (type.equals(CONTROLADOR)) {
|
||||
//Tarea #4280 cambiar a ticket_isOutClosureZone
|
||||
viewModel.ticket_isOutClosureZone(
|
||||
viewModel.ticketIsOutClosureZone(
|
||||
txtscan.toInt()
|
||||
|
||||
)
|
||||
|
@ -1479,7 +1459,7 @@ class CollectionFragmentPreChecker(
|
|||
if (!isOk) {
|
||||
if (txtscan.contains("-")) {
|
||||
tickets.forEach {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
ticketFk = it.toInt(),
|
||||
parking = txtscan
|
||||
)
|
||||
|
@ -1709,7 +1689,7 @@ class CollectionFragmentPreChecker(
|
|||
(sales[position].quantity!! - sales[position].pickedQuantity!!.toInt())
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
//Log.i("VERDNATURA:","Aparece para enviar")
|
||||
|
||||
viewModel.itemPlacementSupplyAiming(
|
||||
itemFk = sales[position].itemFk,
|
||||
quantity = quantityGet,
|
||||
|
@ -2004,16 +1984,6 @@ class CollectionFragmentPreChecker(
|
|||
sales[storedPosition].placements[storedShelvingPosition].visible =
|
||||
"(" + (shelvingVisible.toInt() - quantity.toInt()).toString() + ")"
|
||||
}
|
||||
//Tarea #4371 se quita para ver si funciona correctamente
|
||||
/*viewModel.itemShelvingSaleSupplyAdd(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
saleFk = sales[storedPosition].saleFk,
|
||||
quantity = if (quantity != "0") quantity else customDialogList.getValue()
|
||||
|
||||
)*/
|
||||
|
||||
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
@ -2319,37 +2289,7 @@ class CollectionFragmentPreChecker(
|
|||
hideKeyboards()
|
||||
}
|
||||
|
||||
private fun item_updatePackingShelve(itemFk: Int) {
|
||||
|
||||
|
||||
isMarking = false
|
||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
||||
.setDescription(getString(R.string.packetIndicate))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
customDialogInputPacking(itemFk)
|
||||
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
|
||||
customDialogInput.dismiss()
|
||||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
customDialogInputPacking(itemFk)
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun customDialogInputPacking(itemFk: Int) {
|
||||
/* private fun customDialogInputPacking(itemFk: Int) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
@ -2363,7 +2303,7 @@ class CollectionFragmentPreChecker(
|
|||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
}
|
||||
}*/
|
||||
|
||||
//FALTAS / BASURA / SPLIT
|
||||
|
||||
|
@ -2493,14 +2433,14 @@ class CollectionFragmentPreChecker(
|
|||
private fun changeTicketState() {
|
||||
if (type == CONTROLADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "CHECKED"
|
||||
)
|
||||
}
|
||||
} else if (type == SACADOR) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "PREPARED"
|
||||
)
|
||||
|
@ -2509,7 +2449,7 @@ class CollectionFragmentPreChecker(
|
|||
|
||||
} else if (type == PRECHECKER) {
|
||||
tickets.forEach {
|
||||
viewModel.ticket_setState(
|
||||
viewModel.ticketStateTodaySetState(
|
||||
ticketFk = it.toInt(),
|
||||
state = "PREVIOUS_CONTROLLED"
|
||||
)
|
||||
|
|
|
@ -7,6 +7,7 @@ import androidx.lifecycle.Transformations
|
|||
import es.verdnatura.MobileApplication
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -18,7 +19,6 @@ import es.verdnatura.presentation.view.feature.collection.SalesModifiedList
|
|||
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||
import es.verdnatura.presentation.view.feature.collection.listSaleSalix
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.proposal
|
||||
import es.verdnatura.presentation.view.feature.collection.saleSalix
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
|
@ -27,8 +27,6 @@ import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
|||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.SaleMistakeSalix
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
@ -50,7 +48,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val collectionTicketSalix: LiveData<CollectionTicket>
|
||||
get() = _collectionTicketSalix
|
||||
|
||||
|
||||
private val _collectionTicketListLocal by lazy { MutableLiveData<CollectionTicket>() }
|
||||
val collectionTicketListLocal: LiveData<CollectionTicket>
|
||||
get() = _collectionTicketListLocal
|
||||
|
@ -63,7 +60,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val salesModifiedList: LiveData<SalesModifiedList>
|
||||
get() = _salesModifiedList
|
||||
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
@ -88,14 +84,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseConfirmReservedItemShelvingSale: LiveData<ResponseItemVO>
|
||||
get() = _responseConfirmReservedItemShelvingSale
|
||||
|
||||
|
||||
private val _responseConfirmReservedUpdate by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseConfirmReservedUpdate: LiveData<ResponseItemVO>
|
||||
get() = _responseConfirmReservedUpdate
|
||||
|
||||
|
||||
|
||||
|
||||
private val _responseParking by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseParking: LiveData<ResponseItemVO>
|
||||
get() = _responseParking
|
||||
|
@ -104,7 +96,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responsePrint: LiveData<ResponseItemVO>
|
||||
get() = _responsePrint
|
||||
|
||||
|
||||
private val _responseDel by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseDel: LiveData<ResponseItemVO>
|
||||
get() = _responseDel
|
||||
|
@ -113,9 +104,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseItemShelvingUpdate: LiveData<ResponseItemVO>
|
||||
get() = _responseItemShelvingUpdate
|
||||
|
||||
/* private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleMove: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleMove*/
|
||||
/* private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleMove: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleMove*/
|
||||
|
||||
private val _responseUsedShelves by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseUsedShelves: LiveData<ResponseItemVO>
|
||||
|
@ -141,7 +132,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseCollectionUnchecked: LiveData<ResponseItemVO>
|
||||
get() = _responseCollectionUnchecked
|
||||
|
||||
|
||||
/* private val _responseMissingTrash by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseMissingTrash: LiveData<ResponseItemVO>
|
||||
get() = _responseMissingTrash*/
|
||||
|
@ -178,12 +168,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseGetExtensionFromUserId: LiveData<ResponseItemVO>
|
||||
get() = _responseGetExtensionFromUserId
|
||||
|
||||
|
||||
val loadResponseDel = Transformations.map(_responseDel) { Event(it) }
|
||||
val loadResponseSaleTrackingMark=Transformations.map(_responseSaleTracking_mark) { Event(it) }
|
||||
val loadResponseItemShelvingUpdate=Transformations.map(_responseItemShelvingUpdate) { Event(it) }
|
||||
|
||||
|
||||
val loadResponseSaleTrackingMark = Transformations.map(_responseSaleTracking_mark) { Event(it) }
|
||||
val loadResponseItemShelvingUpdate =
|
||||
Transformations.map(_responseItemShelvingUpdate) { Event(it) }
|
||||
|
||||
fun collectionTicketGet(
|
||||
collectionFk: Int,
|
||||
|
@ -228,7 +216,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
collectionFk: Int,
|
||||
print: Boolean,
|
||||
|
||||
) {
|
||||
) {
|
||||
salix.getCollectionTickets(
|
||||
collectionFk,
|
||||
hashMapOf("print" to print)
|
||||
|
@ -259,9 +247,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
})
|
||||
}
|
||||
/* _collectionTicketListLocal.value = collectionLocal
|
||||
}*/
|
||||
|
||||
/* _collectionTicketListLocal.value = collectionLocal
|
||||
}*/
|
||||
|
||||
fun collection_get(
|
||||
collectionFk: Int,
|
||||
|
@ -308,7 +295,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
vStateFk: String,
|
||||
vIsChecked: String,
|
||||
vBuyFk: Long,
|
||||
vIsScanned:Boolean?
|
||||
vIsScanned: Boolean?
|
||||
) {
|
||||
silex.saleTrackingReplace(
|
||||
saleFk,
|
||||
|
@ -378,9 +365,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun confirmItemShelvingReserved(
|
||||
itemShelvingSaleFk: Int,
|
||||
quantity: Int,
|
||||
isItemShelvingSaleEmpty:Boolean?
|
||||
isItemShelvingSaleEmpty: Boolean?
|
||||
) {
|
||||
salix.itemShelvingsConfirmRerserved(params = ItemShelvingSaleSalix(itemShelvingSaleFk,quantity,isItemShelvingSaleEmpty)
|
||||
salix.itemShelvingsConfirmRerserved(
|
||||
params = ItemShelvingSaleSalix(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty)
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseConfirmReservedItemShelvingSale.value = ResponseItemVO(
|
||||
|
@ -410,7 +398,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
itemShelvingSaleFk: Int,
|
||||
isPicked: Boolean
|
||||
) {
|
||||
salix.itemShelvingsReservedUpdate(id =itemShelvingSaleFk, params = hashMapOf("isPicked" to isPicked)
|
||||
salix.itemShelvingsReservedUpdate(
|
||||
id = itemShelvingSaleFk, params = hashMapOf("isPicked" to isPicked)
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseConfirmReservedUpdate.value = ResponseItemVO(
|
||||
|
@ -441,34 +430,17 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
quantity: Int,
|
||||
itemFk: Int
|
||||
) {
|
||||
silex.itemPlacementSupplyAiming(
|
||||
shelvingFk,
|
||||
quantity,
|
||||
itemFk
|
||||
salix.itemPlacementSupplyAiming(
|
||||
arrayListOf(
|
||||
shelvingFk,
|
||||
quantity,
|
||||
itemFk
|
||||
).formatWithQuotes()
|
||||
).enqueue(object :
|
||||
Callback<List<PlacementSupplyVO>> {
|
||||
override fun onFailure(call: Call<List<PlacementSupplyVO>>, t: Throwable) {
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
PlacementSupplyVO(
|
||||
itemShelvingFk = 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<PlacementSupplyVO>>,
|
||||
response: Response<List<PlacementSupplyVO>>
|
||||
) {
|
||||
SalixCallback<List<PlacementSupplyVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<PlacementSupplyVO>>) {
|
||||
if (response.body() != null) {
|
||||
val mappedList = response.body()?.map { it.proposal(context) }
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(mappedList.orEmpty())
|
||||
|
||||
|
||||
// _placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) }
|
||||
_placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -484,112 +456,77 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelvingSaleSupplyAdd(
|
||||
usuario: String,
|
||||
password: String,
|
||||
itemShelvingFk: String,
|
||||
saleFk: String,
|
||||
quantity: String
|
||||
) {
|
||||
silex.itemShelvingSaleSupplyAdd(
|
||||
usuario,
|
||||
password,
|
||||
itemShelvingFk,
|
||||
saleFk,
|
||||
quantity
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseItemShelvingSaleSupplyAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
PlacementSupplyVO(
|
||||
itemShelvingFk = 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseItemShelvingSaleSupplyAdd.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun collectionStickerPrint(
|
||||
collectionFk: Int,
|
||||
labelCount: Int?
|
||||
) {
|
||||
silex.collectionStickerPrint(
|
||||
collectionFk,
|
||||
labelCount
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.collectionStickerPrint(
|
||||
arrayListOf(
|
||||
collectionFk,
|
||||
labelCount
|
||||
)
|
||||
).enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responsePrint.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responsePrint.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_responsePrint.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun ticketCollection_setUsedShelves(
|
||||
ticketFk: Int,
|
||||
usedShelves: Int
|
||||
) {
|
||||
salix.ticketCollectionUpdate("""where={"ticketFk":$ticketFk}""", hashMapOf("usedShelves" to usedShelves))
|
||||
.enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
salix.ticketCollectionUpdate(
|
||||
"""where={"ticketFk":$ticketFk}""",
|
||||
hashMapOf("usedShelves" to usedShelves)
|
||||
)
|
||||
.enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_responseUsedShelves.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
_responseUsedShelves.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_responseUsedShelves.value = ResponseItemVO(isError = false)
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_responseUsedShelves.value = ResponseItemVO(isError = false)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun item_updatePackingShelve(
|
||||
vSelf: Int,
|
||||
vPacking: Int
|
||||
) {
|
||||
silex.item_updatePackingShelve(
|
||||
vSelf,
|
||||
vPacking
|
||||
).enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseItem_updatePackingShelve.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_responseItem_updatePackingShelve.value = ResponseItemVO(isError = false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun saleTracking_add(
|
||||
fun saleTrackingAddPreparedSaleGroup(
|
||||
saleGroupFk: Int
|
||||
) {
|
||||
silex.saleTracking_add(
|
||||
saleGroupFk
|
||||
salix.saleTrackingAddPreparedSaleGroup(
|
||||
arrayListOf(
|
||||
saleGroupFk
|
||||
)
|
||||
).enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleGroup.value = ResponseItemVO(
|
||||
|
@ -632,45 +569,44 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
/* fun saleMove(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleFk: String,
|
||||
quantity: String,
|
||||
originalQuantity: String
|
||||
) {
|
||||
silex.saleMove(
|
||||
usuario,
|
||||
password,
|
||||
saleFk,
|
||||
quantity,
|
||||
originalQuantity
|
||||
).enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_responseSaleMove.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
/* fun saleMove(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleFk: String,
|
||||
quantity: String,
|
||||
originalQuantity: String
|
||||
) {
|
||||
silex.saleMove(
|
||||
usuario,
|
||||
password,
|
||||
saleFk,
|
||||
quantity,
|
||||
originalQuantity
|
||||
).enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_responseSaleMove.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
|
||||
} else {
|
||||
_responseSaleMove.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_responseSaleMove.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
} else {
|
||||
_responseSaleMove.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
fun transferSalesSalix(
|
||||
ticketFk: String,
|
||||
|
@ -683,7 +619,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
salix.transferSalesSalix(
|
||||
ticketFk, saleTransfer
|
||||
|
||||
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSplit.value = ResponseItemVO(
|
||||
|
@ -711,7 +646,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
fun saleTrackingDel(saleFk: Int) {
|
||||
silex.saleTrackingDel(saleFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
@ -752,101 +686,46 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun parking(
|
||||
fun setParking(
|
||||
ticketFk: Int,
|
||||
parking: String
|
||||
) {
|
||||
silex.shelvingPark(ticketFk, parking)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
salix.setParking(arrayListOf(ticketFk, parking).formatWithQuotes())
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseParking.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseParking.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseParking.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun ticket_setState(
|
||||
fun ticketStateTodaySetState(
|
||||
ticketFk: Int,
|
||||
state: String
|
||||
) {
|
||||
silex.ticket_setState(ticketFk, state)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
salix.ticketStateTodaySetState(arrayListOf(ticketFk, state).formatWithQuotes())
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = "")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun debug_add(
|
||||
|
||||
buyFk: String,
|
||||
message: String
|
||||
) {
|
||||
//TAREA 5134
|
||||
//Borrar
|
||||
silex.debug_add(buyFk, message)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = "")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/* fun getIdFromCode(usuario: String, password: String, code: String) {
|
||||
silex.getIdFromCode(usuario, password, code)
|
||||
.enqueue(object : Callback<String> {
|
||||
override fun onFailure(call: Call<String>, t: Throwable) {
|
||||
_responseCode.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<String>, response: Response<String>) {
|
||||
//sergio:devuelve item
|
||||
if (response.body() == null) {
|
||||
_responseCode.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_responseCode.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
fun getIdFromCodeSalix(code: String) {
|
||||
salix.barcodes_toitem(code)
|
||||
.enqueue(object : SilexCallback<String?>(context) {
|
||||
|
@ -859,24 +738,25 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
override fun onSuccess(response: Response<String?>) {
|
||||
|
||||
_responseCode.value =
|
||||
ResponseItemVO(
|
||||
isError = false,
|
||||
response = if (response.body() == null) "" else{response!!.body().toString()}
|
||||
)
|
||||
_responseCode.value =
|
||||
ResponseItemVO(
|
||||
isError = false,
|
||||
response = if (response.body() == null) "" else {
|
||||
response!!.body().toString()
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun collectionIncreaseQuantitySalix(
|
||||
saleFk: Int,
|
||||
quantity: String
|
||||
) {
|
||||
salix.collectionIncreaseQuantitySalix(
|
||||
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.collectionIncreaseQuantitySalix(
|
||||
SalixSaleQuantity(saleId = saleFk, quantity = quantity.toInt())
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseIncQuantity.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -893,54 +773,60 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
/* fun sendChekingPresence(
|
||||
workerId: String,
|
||||
message: String
|
||||
/* fun sendChekingPresence(
|
||||
workerId: String,
|
||||
message: String
|
||||
|
||||
) {
|
||||
try {
|
||||
salix.sendChekingPresence(
|
||||
SalixMessageVO(
|
||||
workerId = workerId.toInt(),
|
||||
message = message
|
||||
)
|
||||
)
|
||||
.enqueue(object : Callback<Boolean> {
|
||||
override fun onResponse(call: Call<Boolean>, response: Response<Boolean>) {
|
||||
) {
|
||||
try {
|
||||
salix.sendChekingPresence(
|
||||
SalixMessageVO(
|
||||
workerId = workerId.toInt(),
|
||||
message = message
|
||||
)
|
||||
)
|
||||
.enqueue(object : Callback<Boolean> {
|
||||
override fun onResponse(call: Call<Boolean>, response: Response<Boolean>) {
|
||||
|
||||
if (!response.isSuccessful || response.message() == "false") {
|
||||
_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
if (!response.isSuccessful || response.message() == "false") {
|
||||
_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<Boolean>, t: Throwable) {
|
||||
_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), t.message!!
|
||||
)
|
||||
)
|
||||
override fun onFailure(call: Call<Boolean>, t: Throwable) {
|
||||
_responseSalixMessage.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), t.message!!
|
||||
)
|
||||
)
|
||||
|
||||
//Log.i("Salix Error",""+t.message)
|
||||
}
|
||||
})
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
//Log.i("Salix Error",""+t.message)
|
||||
}
|
||||
})
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
|
||||
}*/
|
||||
}*/
|
||||
|
||||
fun saleMistakeAdd(
|
||||
saleFk: Int,
|
||||
typeFk: Int
|
||||
) {
|
||||
|
||||
salix.saleMistakeAdd(SaleMistakeSalix(userFk=(context as MobileApplication).userId!!, saleFk = saleFk,typeFk = typeFk))
|
||||
salix.saleMistakeAdd(
|
||||
SaleMistakeSalix(
|
||||
userFk = (context as MobileApplication).userId!!,
|
||||
saleFk = saleFk,
|
||||
typeFk = typeFk
|
||||
)
|
||||
)
|
||||
.enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -959,19 +845,9 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun mistakeType() {
|
||||
|
||||
//Tarea 5134
|
||||
salix.getMistakeTypes()
|
||||
//silex.mistakeType()
|
||||
.enqueue(object : SilexCallback<List<MistakeTypeVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<MistakeTypeVO> = ArrayList()
|
||||
listError.add(MistakeTypeVO(0, ""))
|
||||
_mistakeList.value = MistakeTypeListVO(listError)
|
||||
}
|
||||
|
||||
.enqueue(object : SalixCallback<List<MistakeTypeVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<MistakeTypeVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_mistakeList.value = response.body()?.let { MistakeTypeListVO(it) }
|
||||
} else {
|
||||
|
@ -981,15 +857,43 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<MistakeTypeVO> = ArrayList()
|
||||
listError.add(MistakeTypeVO(0, ""))
|
||||
_mistakeList.value = MistakeTypeListVO(listError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun ticket_isOutClosureZone(
|
||||
fun ticketIsOutClosureZone(
|
||||
ticketFk: Int
|
||||
) {
|
||||
silex.ticket_isOutClosureZone(
|
||||
ticketFk
|
||||
salix.ticketIsOutClosureZone(
|
||||
arrayListOf(ticketFk)
|
||||
).enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseTicketClosure.value = ResponseItemVO(
|
||||
isError = false,
|
||||
response = response.body()!!.toString(),
|
||||
errorMessage = ""
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseTicketClosure.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun ticket_isOutClosureZoneNew(
|
||||
ticketFk: Int
|
||||
) {
|
||||
salix.ticketIsOutClosureZone(
|
||||
params = arrayListOf(ticketFk)
|
||||
).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -1010,6 +914,31 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun callBackSalix(function: String, params: ArrayList<Any>) {
|
||||
salix.executeFunc(
|
||||
routine = function, params = params
|
||||
).enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseTicketClosure.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseTicketClosure.value = ResponseItemVO(
|
||||
isError = false,
|
||||
response = response.body()!!.toString(),
|
||||
errorMessage = ""
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun collection_getUncheckedTicket(
|
||||
collectionFk: Int
|
||||
) {
|
||||
|
|
|
@ -167,10 +167,8 @@ class ControlVehiculoFragment(
|
|||
private fun checkControlTimeVehicle() {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.workerMachinery_isRegistered()
|
||||
|
||||
viewModel.workerMachineryIsRegistered(mobileApplication.userId!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +176,6 @@ class ControlVehiculoFragment(
|
|||
|
||||
if (direction.equals("HISTORY")) {
|
||||
|
||||
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = getString(R.string.titleHistoricalHide)),
|
||||
plateNumber
|
||||
|
|
|
@ -16,7 +16,6 @@ import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
|||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.common.loadUrl
|
||||
|
||||
|
||||
class ControlVehiculoUsuarioFragment(
|
||||
var vUserFK: Int
|
||||
) : BaseFragment<FragmentVehiclecontrolUserBinding, ControlVehiculoViewModel>(
|
||||
|
@ -27,7 +26,6 @@ class ControlVehiculoUsuarioFragment(
|
|||
private var goBack: Boolean = false
|
||||
override fun getLayoutId(): Int = R.layout.fragment_vehiclecontrol_user
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(vUserFK: Int) = ControlVehiculoUsuarioFragment(vUserFK)
|
||||
}
|
||||
|
@ -86,22 +84,21 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
userFk = mobileApplication.userId!!
|
||||
|
||||
if (userFk == vUserFK.toInt()) {
|
||||
if (userFk == vUserFK) {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.machine_getWorkerPlate()
|
||||
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
||||
viewModel.deviceProduction_getnameDevice(
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
viewModel.deviceProductionUser_getWorker(
|
||||
viewModel.deviceProductionUserGetWorker(
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
|
||||
} else {
|
||||
userFk = vUserFK.toInt()
|
||||
userFk = vUserFK
|
||||
binding.userInformation.visibility = INVISIBLE
|
||||
binding.nameVehiclecontrol.visibility = INVISIBLE
|
||||
binding.userImage.setOnClickListener { binding.mainToolbar.backButton.performClick() }
|
||||
viewModel.machine_getWorkerPlate()
|
||||
viewModel.machineGetWorkerPlate(mobileApplication.userId!!)
|
||||
}
|
||||
|
||||
binding.userImage.loadUrl(
|
||||
|
@ -123,10 +120,8 @@ class ControlVehiculoUsuarioFragment(
|
|||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
|
@ -140,7 +135,6 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
} else {
|
||||
|
||||
|
||||
if (it.response == "false") {
|
||||
if (it.type.equals("getWorker")) {
|
||||
binding.assignedDevicename.text =
|
||||
|
@ -152,6 +146,7 @@ class ControlVehiculoUsuarioFragment(
|
|||
"getnameDevice" -> binding.deviceName.text = it.response
|
||||
"getWorker" -> binding.assignedDevicename.text =
|
||||
it.response
|
||||
|
||||
"getWorkerPlate" -> binding.registeredVehiclecontrol.text = it.response
|
||||
}
|
||||
|
||||
|
@ -184,7 +179,6 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
private fun callPicker(extensionNumber: String) {
|
||||
|
||||
|
||||
try {
|
||||
val intent = Intent(Intent.ACTION_DIAL).apply {
|
||||
data = Uri.parse("tel:$extensionNumber")
|
||||
|
@ -195,6 +189,5 @@ class ControlVehiculoUsuarioFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,10 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.domain.model.Filter
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
|
@ -108,32 +110,28 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun workerMachinery_isRegistered() {
|
||||
silex.workerMachinery_isRegistered()
|
||||
.enqueue(object : SilexCallback<String>(context) {
|
||||
fun workerMachineryIsRegistered(userId: Int) {
|
||||
salix.workerMachineryIsRegistered(arrayListOf(userId))
|
||||
.enqueue(object : SalixCallback<String>(context) {
|
||||
override fun onSuccess(response: Response<String>) {
|
||||
_responsecontrol.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responsecontrol.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<String>) {
|
||||
_responsecontrol.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun deviceProduction_getnameDevice(android_id: String) {
|
||||
|
||||
salix.deviceProductionsGetName(
|
||||
|
@ -173,10 +171,28 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun deviceProductionUser_getWorker(android_id: String) {
|
||||
silex.deviceProductionUser_getWorker(
|
||||
android_id
|
||||
).enqueue(object : SilexCallback<String>(context) {
|
||||
fun deviceProductionUserGetWorker(androidId: String) {
|
||||
salix.deviceProductionUserGetWorker(
|
||||
arrayListOf(
|
||||
androidId
|
||||
).formatWithQuotes()
|
||||
).enqueue(object : SalixCallback<List<JsonObject>>(context) {
|
||||
override fun onSuccess(response: Response<List<JsonObject>>) {
|
||||
_responsemachine.value =
|
||||
ResponseItemMachineControl(
|
||||
isError = false,
|
||||
response = if (response.body()!!.isEmpty()) {
|
||||
""
|
||||
} else {
|
||||
(response.body()!![0].entrySet().first().value.toString()).replace(
|
||||
"\"",
|
||||
""
|
||||
)
|
||||
},
|
||||
type = "getWorker"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responsemachine.value = ResponseItemMachineControl(
|
||||
isError = true,
|
||||
|
@ -184,58 +200,34 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
type = ""
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<String>) {
|
||||
if (response.body() != null) {
|
||||
|
||||
_responsemachine.value =
|
||||
ResponseItemMachineControl(
|
||||
isError = false,
|
||||
response = response.body()!!.toString(),
|
||||
type = "getWorker"
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun machineGetWorkerPlate(userId: Int) {
|
||||
salix.machineGetWorkerPlate(
|
||||
arrayListOf(userId)
|
||||
).enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
var myArray = response.body() as ArrayList<Any>
|
||||
_responsemachine.value =
|
||||
ResponseItemMachineControl(
|
||||
isError = false,
|
||||
response = if (myArray.isEmpty()) {
|
||||
""
|
||||
} else {
|
||||
response.body()!!.toString()
|
||||
},
|
||||
type = "getWorkerPlate"
|
||||
)
|
||||
}
|
||||
|
||||
fun machine_getWorkerPlate() {
|
||||
silex.machine_getWorkerPlate(
|
||||
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
|
||||
_responsemachine.value = ResponseItemMachineControl(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!),
|
||||
type = ""
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
//sergio: devuelve en el body
|
||||
if (response.body() == null) {
|
||||
ResponseItemMachineControl(
|
||||
isError = false,
|
||||
response = response.body()!!.toString(),
|
||||
type = "getWorkerPlate"
|
||||
)
|
||||
|
||||
} else {
|
||||
_responsemachine.value =
|
||||
ResponseItemMachineControl(
|
||||
isError = false,
|
||||
response = response.body()!!.toString(),
|
||||
type = "getWorkerPlate"
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class InfoFragment(var title: String) :
|
|||
binding.mainToolbar.toolbarTitle.text = title
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getInfoCompany(mobileApplication.userId!!)
|
||||
viewModel.companyGetFiscaldata(mobileApplication.userId!!)
|
||||
viewModel.getInfoFreelance(mobileApplication.userId!!)
|
||||
setEvents()
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import es.verdnatura.presentation.view.feature.delivery.adapters.ExpeditionLoadU
|
|||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicket
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoPending
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalix
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
|
||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -35,7 +36,6 @@ import kotlinx.coroutines.withContext
|
|||
import org.json.JSONObject
|
||||
import java.util.Date
|
||||
|
||||
|
||||
class LoadUnloadFragment(
|
||||
var title: String = "",
|
||||
var state: String = "",
|
||||
|
@ -56,6 +56,7 @@ class LoadUnloadFragment(
|
|||
private lateinit var db: DeliveryDatabase
|
||||
|
||||
companion object {
|
||||
var scanned = false
|
||||
fun newInstance(
|
||||
title: String,
|
||||
state: String,
|
||||
|
@ -63,6 +64,11 @@ class LoadUnloadFragment(
|
|||
clientTicketList: ArrayList<ClientTicket>? = null
|
||||
) =
|
||||
LoadUnloadFragment(title, state, entryPoint, clientTicketList)
|
||||
|
||||
fun scanning(scan: Boolean) {
|
||||
scanned = scan
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_expedition_loadunload_delivery
|
||||
|
@ -74,15 +80,12 @@ class LoadUnloadFragment(
|
|||
addressFk = JSONObject(entryPoint).get("address").toString().toInt()
|
||||
} catch (ex: Exception) {
|
||||
}
|
||||
|
||||
setEvents()
|
||||
setToolBar()
|
||||
setSwitchButon()
|
||||
binding.scanInput.requestFocus()
|
||||
viewModel.getExpeditionFromRoute(route)
|
||||
|
||||
super.init()
|
||||
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
|
@ -141,7 +144,7 @@ class LoadUnloadFragment(
|
|||
//openSignActivity()
|
||||
}
|
||||
}
|
||||
} catch (ex:Exception){
|
||||
} catch (ex: Exception) {
|
||||
//Tarea 5313
|
||||
getString(R.string.errorNotData).toast(requireContext())
|
||||
}
|
||||
|
@ -162,15 +165,27 @@ class LoadUnloadFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setExpeditionsState(list: MutableList<ExpeditionInfoLoadUnload>, state: String) {
|
||||
|
||||
scanning(false)
|
||||
var mlist = mutableListOf<ExpeditionSalix>()
|
||||
for (l in list) {
|
||||
mlist.add(
|
||||
ExpeditionSalix(
|
||||
expeditionFk = l.id, stateCode = if (l.code != state && l.code != "FOUND") {
|
||||
"LOST"
|
||||
} else {
|
||||
l.code
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
var expeditionBack = hashMapOf("expeditions" to mlist as List<ExpeditionSalix>)
|
||||
if (list.filter { it.code == state }.isNotEmpty()) {
|
||||
if (list.filter { it.code == state }.size == list.size) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionState_add(list.filter { it.code == state }, state)
|
||||
viewModel.expeditionStateAddSalix(expeditionBack)
|
||||
counterCalls = 1
|
||||
} else {
|
||||
val alertDialog = android.app.AlertDialog.Builder(requireContext()).create()
|
||||
|
@ -179,22 +194,8 @@ class LoadUnloadFragment(
|
|||
alertDialog.setButton(
|
||||
android.app.AlertDialog.BUTTON_NEUTRAL, getString(R.string.save)
|
||||
) { dialog, which ->
|
||||
|
||||
counterCalls = 2
|
||||
if (list.filter { it.code == state }.isEmpty()) {
|
||||
counterCalls--
|
||||
} else {
|
||||
viewModel.expeditionState_add(list.filter { it.code == state }, state)
|
||||
}
|
||||
if (list.filter { it.code != state && it.code != "FOUND" }.isEmpty()) {
|
||||
counterCalls--
|
||||
} else {
|
||||
viewModel.expeditionState_add(
|
||||
list.filter { it.code != state && it.code != "FOUND" },
|
||||
"LOST"
|
||||
)
|
||||
}
|
||||
|
||||
counterCalls = 1
|
||||
viewModel.expeditionStateAddSalix(expeditionBack)
|
||||
}
|
||||
alertDialog.setButton(
|
||||
android.app.AlertDialog.BUTTON_POSITIVE, getString(R.string.ordenar)
|
||||
|
@ -303,6 +304,7 @@ class LoadUnloadFragment(
|
|||
}
|
||||
if (found) {
|
||||
ma.messageWithSound("", false, true, isToasted = false)
|
||||
scanning(true)
|
||||
} else {
|
||||
ma.messageWithSound("", true, true, isToasted = null)
|
||||
}
|
||||
|
@ -340,7 +342,6 @@ class LoadUnloadFragment(
|
|||
if (!it.isError) {
|
||||
counterResponse = counterResponse + 1
|
||||
if (counterResponse == counterCalls) {
|
||||
// viewModel.getExpeditionFromRoute(route)
|
||||
if (!binding.mainToolbar.switchButton.isChecked) {
|
||||
if (state == "DELIVERED") {
|
||||
openSignActivity()
|
||||
|
@ -425,11 +426,9 @@ class LoadUnloadFragment(
|
|||
|
||||
private fun createList(list: MutableList<ExpeditionInfoLoadUnload>, getSaved: Boolean = false) {
|
||||
|
||||
|
||||
lifecycleScope.launch {
|
||||
withContext(Dispatchers.IO) {
|
||||
|
||||
|
||||
if (getSaved) {
|
||||
myList =
|
||||
db.expedicionDao()
|
||||
|
@ -468,7 +467,6 @@ class LoadUnloadFragment(
|
|||
setListPosition(myList)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun updateExpeditionTable(list: List<ExpeditionInfoLoadUnload>) {
|
||||
|
|
|
@ -19,12 +19,12 @@ import es.verdnatura.presentation.base.BaseFragment
|
|||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.feature.delivery.adapters.ExpeditionLogAdapter
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.Expedition
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSalix
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.Expeditions
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
||||
|
||||
|
||||
class LogExpeditionFragment(
|
||||
var title: String = ""
|
||||
) : BaseFragment<FragmentExpeditionLogDeliveryBinding, DeliveryViewModel>(
|
||||
|
@ -175,21 +175,26 @@ class LogExpeditionFragment(
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
||||
if (isChecked) {
|
||||
|
||||
/*viewModel.expeditionStateAddSalix(Expeditions(listOf(
|
||||
ExpeditionSalix(expeditionFk = originalItem, stateCode = "ON DELIVERY"))))*/
|
||||
viewModel.expeditionState_add(arrayListOf(Expedition(originalItem)), "FOUND")
|
||||
viewModel.expeditionStateAddSalix(
|
||||
Expeditions(
|
||||
listOf(
|
||||
ExpeditionSalix(expeditionFk = originalItem, stateCode = "FOUND")
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
/* viewModel.expeditionStateAddSalix(Expeditions(listOf(
|
||||
ExpeditionSalix(expeditionFk = originalItem, stateCode = "LOST"))))*/
|
||||
|
||||
viewModel.expeditionState_add(arrayListOf(Expedition(originalItem)), "LOST")
|
||||
viewModel.expeditionStateAddSalix(
|
||||
Expeditions(
|
||||
listOf(
|
||||
ExpeditionSalix(expeditionFk = originalItem, stateCode = "LOST")
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun setInfoText(routeDelivery: RouteDelivery) {
|
||||
binding.routeLayout.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||
|
|
|
@ -60,7 +60,7 @@ class RoutesFragment(
|
|||
setToolBar()
|
||||
binding.scanInput.requestFocus()
|
||||
pendingOperations()
|
||||
callBack(viewModel.getRoutes(mobileApplication.userId!!))
|
||||
callBack(viewModel.getRoutes(mobileApplication.userId!!))
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -514,7 +514,9 @@ class TicketsFragment(
|
|||
customDialogInput.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
customDialogInput.setOkButton(getString(R.string.save)) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.addNotes(itemClient.tickets, customDialogInput.getValue())
|
||||
customDialogInput.dismiss()
|
||||
}
|
||||
.setKoButton(getString(R.string.cancel)) {
|
||||
customDialogInput.cancel()
|
||||
|
|
|
@ -31,7 +31,7 @@ class Expeditions(
|
|||
|
||||
class ExpeditionSalix(
|
||||
val expeditionFk: Int,
|
||||
val stateCode: String
|
||||
val stateCode: String?
|
||||
)
|
||||
|
||||
class ExpeditionInfoList(
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.delivery.viewmodels
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
|
@ -8,6 +7,7 @@ import androidx.lifecycle.Transformations
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
@ -20,7 +20,6 @@ import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
|||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionList
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionSummaryList
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.Expeditions
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.FreeLanceDeliveryInfoList
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDelivery
|
||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteDeliveryList
|
||||
|
@ -72,7 +71,6 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO> = _response
|
||||
|
||||
|
||||
private val _responseSign by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSign: LiveData<ResponseItemVO> = _responseSign
|
||||
|
@ -82,33 +80,24 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
val loadRouteList = Transformations.map(_routeList) { Event(it) }
|
||||
|
||||
|
||||
private val _responseLoadList by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseLoadList: LiveData<ResponseItemVO> = _responseLoadList
|
||||
|
||||
private val _responseStateList by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseStateList: LiveData<ResponseItemVO> = _responseStateList
|
||||
|
||||
fun getInfoCompany(
|
||||
fun companyGetFiscaldata(
|
||||
userId: Int
|
||||
) {
|
||||
|
||||
silex.getInfoCompany(userId)
|
||||
.enqueue(object : SilexCallback<List<DeliveryInfo>>(context) {
|
||||
salix.companyGetFiscaldata(arrayListOf(userId))
|
||||
.enqueue(object : SalixCallback<List<DeliveryInfo>>(context) {
|
||||
override fun onSuccess(response: Response<List<DeliveryInfo>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_companyInfoList.value =
|
||||
response.body()?.let { FreeLanceDeliveryInfoList(it) }
|
||||
} else {
|
||||
_companyInfoList.value = FreeLanceDeliveryInfoList()
|
||||
}
|
||||
_companyInfoList.value = response.body()?.let { FreeLanceDeliveryInfoList(it) }
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_companyInfoList.value = FreeLanceDeliveryInfoList()
|
||||
super.onError(t)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -141,18 +130,11 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun getExpeditionFromRoute(
|
||||
route: Int
|
||||
) {
|
||||
|
||||
silex.getExpeditionFromRoute(route)
|
||||
.enqueue(object : SilexCallback<MutableList<ExpeditionInfoLoadUnload>>(context) {
|
||||
|
||||
override fun onSuccess(response: Response<MutableList<ExpeditionInfoLoadUnload>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_expeditionInfoLoadUnloadList.value =
|
||||
response.body()?.let { ExpeditionList(it) }
|
||||
} else {
|
||||
_expeditionInfoLoadUnloadList.value = ExpeditionList()
|
||||
}
|
||||
salix.expeditionGetFromRoute(arrayListOf(route))
|
||||
.enqueue(object : SalixCallback<List<ExpeditionInfoLoadUnload>>(context) {
|
||||
override fun onSuccess(response: Response<List<ExpeditionInfoLoadUnload>>) {
|
||||
_expeditionInfoLoadUnloadList.value =
|
||||
response.body()?.let { ExpeditionList(it) }
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -162,7 +144,6 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
fun get_routesFromExpedition(
|
||||
expedition: Int
|
||||
) {
|
||||
|
@ -202,12 +183,11 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_responseStateList.value = ResponseItemVO("", true, t.message.toString(), 0)
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionStateAddSalix(expeditions: Expeditions) {
|
||||
fun expeditionStateAddSalix(expeditions: Any) {
|
||||
|
||||
salix.addExpeditionState(expeditions)
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
|
@ -221,20 +201,18 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_responseStateList.value = ResponseItemVO("", true, t.message.toString(), 0)
|
||||
|
||||
_responseStateAdd.value = ResponseItemVO("", true, t.message.toString(), 0)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun getInfoFreelance(
|
||||
userId: Int
|
||||
) {
|
||||
silex.getInfoFreelance(userId)
|
||||
.enqueue(object : SilexCallback<List<DeliveryInfo>>(context) {
|
||||
|
||||
salix.freelanceGetInfo(arrayListOf(userId))
|
||||
.enqueue(object : SalixCallback<List<DeliveryInfo>>(context) {
|
||||
override fun onSuccess(response: Response<List<DeliveryInfo>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_freelanceInfoList.value =
|
||||
response.body()?.let { FreeLanceDeliveryInfoList(it) }
|
||||
|
@ -246,7 +224,6 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
override fun onError(t: Throwable) {
|
||||
_freelanceInfoList.value = FreeLanceDeliveryInfoList()
|
||||
super.onError(t)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -327,9 +304,9 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun driverRouteEmail(
|
||||
routeId: Long,
|
||||
email:String
|
||||
email: String
|
||||
) {
|
||||
salix.driverRouteEmail(id = routeId,hashMapOf("recipient" to email))
|
||||
salix.driverRouteEmail(id = routeId, hashMapOf("recipient" to email))
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
@ -387,25 +364,25 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
listTickets: MutableList<Ticket>,
|
||||
note: String
|
||||
|
||||
|
||||
) {
|
||||
silex.addNotes(
|
||||
mapOf(
|
||||
"Tickets" to listTickets.map { it.Id },
|
||||
"note" to note
|
||||
)
|
||||
salix.addNote(
|
||||
arrayListOf(listTickets[0].Id, note).formatWithQuotes()
|
||||
)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
||||
/* silex.addNotes(
|
||||
mapOf(
|
||||
"Tickets" to listTickets.map { it.Id },
|
||||
"note" to note
|
||||
)
|
||||
)*/
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(response = context.getString(R.string.noteAddOk))
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(response = context.getString(R.string.noteAddOk))
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO()
|
||||
super.onError(t)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -464,8 +441,6 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun createJSONObject(listTickets: MutableList<Ticket>, note: String): String {
|
||||
// Supongamos que tienes la lista de tickets y el valor como los siguientes:
|
||||
// val listTickets: List<String> = listOf("4255452", "5454515")
|
||||
// val note: String = "Mi nota"
|
||||
|
||||
// Crear el objeto JSON
|
||||
val jsonObject = JSONObject()
|
||||
val jsonArrayTickets = JSONArray(listTickets)
|
||||
|
|
|
@ -18,7 +18,6 @@ import es.verdnatura.presentation.view.component.CustomDialog
|
|||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.adapter.DayOfSaleAdapter
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class DayOfSaleFragment(
|
||||
var entryPoint: String = ""
|
||||
|
@ -72,7 +71,6 @@ class DayOfSaleFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
|
@ -102,14 +100,12 @@ class DayOfSaleFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
private fun getItemsSaleDate(vShelvingFK: String) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelving_getSaleDate(vShelvingFK)
|
||||
viewModel.itemShelvingGetSaleDate(vShelvingFK)
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
|
@ -140,7 +136,6 @@ class DayOfSaleFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
|
@ -159,10 +154,8 @@ class DayOfSaleFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,19 +185,16 @@ class DayOfSaleFragment(
|
|||
false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun parking(parking: String) {
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
parking = parking,
|
||||
scanItem = itemScan
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -21,54 +22,57 @@ class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
|
||||
private val _itemShelvingSaleDateList by lazy { MutableLiveData<ItemShelvingSaleDateList>() }
|
||||
val itemShelvingSaleDateList: LiveData<ItemShelvingSaleDateList>
|
||||
get() = _itemShelvingSaleDateList
|
||||
|
||||
val loadItemShelvingSaleDateList = Transformations.map(_itemShelvingSaleDateList) { Event(it) }
|
||||
|
||||
fun itemShelving_getSaleDate(vShelvingFK: String) {
|
||||
silex.itemShelving_getSaleDate(vShelvingFK).enqueue(object :
|
||||
SilexCallback<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>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
|
||||
_itemShelvingSaleDateList.value = response.body()?.let {
|
||||
ItemShelvingSaleDateList(it)
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!response.isSuccessful) {
|
||||
|
||||
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingSaleDate(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
fun itemShelvingGetSaleDate(vShelvingFK: String) {
|
||||
salix.itemShelvingGetSaleDate(params = listOf(vShelvingFK).formatWithQuotes())
|
||||
.enqueue(object :
|
||||
SalixCallback<List<ItemShelvingSaleDate>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingSaleDate(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
_itemShelvingSaleDateList.value = ItemShelvingSaleDateList(listError)
|
||||
)
|
||||
_itemShelvingSaleDateList.value = ItemShelvingSaleDateList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemShelvingSaleDate>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
|
||||
_itemShelvingSaleDateList.value = response.body()?.let {
|
||||
ItemShelvingSaleDateList(it)
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!response.isSuccessful) {
|
||||
|
||||
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingSaleDate(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemShelvingSaleDateList.value = ItemShelvingSaleDateList(listError)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/* fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
|
||||
|
@ -81,25 +85,24 @@ class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
|
|||
return list
|
||||
}*/
|
||||
|
||||
fun parking(scanItem: String, parking: String) {
|
||||
silex.shelvingPark(scanItem, parking).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
fun setParking(scanItem: String, parking: String) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
|
||||
.enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, 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!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHisto
|
|||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class HistoricoArticuloFragment(
|
||||
var itemFk: Int?
|
||||
|
@ -44,19 +43,15 @@ class HistoricoArticuloFragment(
|
|||
|
||||
override fun init() {
|
||||
|
||||
// customDialogInput = CustomDialogInput(requireContext())
|
||||
// customDialog = CustomDialog(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
filter = "all"
|
||||
itemFk?.let { viewModel.itemDiary(it, getDataInt(WAREHOUSEFK)) }
|
||||
itemFk?.let { viewModel.itemGetBalance(it, getDataInt(WAREHOUSEFK)) }
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.itemdiary) + ":" + itemFk
|
||||
setToolBar()
|
||||
setEvents()
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
private fun setToolBar() {
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
|
@ -112,7 +107,7 @@ class HistoricoArticuloFragment(
|
|||
private fun viewModelwithFilter(keyfilter: String) {
|
||||
filter = keyfilter
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
itemFk?.let { viewModel.itemDiary(it, getDataInt(WAREHOUSEFK)) }
|
||||
itemFk?.let { viewModel.itemGetBalance(it, getDataInt(WAREHOUSEFK)) }
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
|
@ -168,21 +163,20 @@ class HistoricoArticuloFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun listToAdapter(lista: List<ItemHistoricoVO>, filter: String) {
|
||||
|
||||
listHistoric.clear()
|
||||
listHistoryAux.clear()
|
||||
lista.forEach {
|
||||
|
||||
if (it.shipped != null) {
|
||||
it.shipped =
|
||||
it.shipped!!.replace("T", " ").substring(0, it.shipped!!.length - 5)
|
||||
}
|
||||
if (filter.equals("all")) {
|
||||
listHistoric.add(it)
|
||||
// listHistoryAux.add(it)
|
||||
} else {
|
||||
|
||||
if (it.name?.contains(filter, true)!!) {
|
||||
listHistoric.add(it)
|
||||
// listHistoryAux.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -19,13 +19,15 @@ class HistoricoArticuloViewModel(val context: Context) : BaseViewModel(context)
|
|||
val historicoList: LiveData<ItemHistoricoListVO>
|
||||
get() = _historicoList
|
||||
|
||||
|
||||
val loadHistoricoList = Transformations.map(_historicoList) { Event(it) }
|
||||
|
||||
fun itemGetBalance(itemFk: Int, vWarehouseFk: Int) {
|
||||
salix.itemGetBalance(arrayListOf(itemFk, vWarehouseFk, null)).enqueue(object :
|
||||
SalixCallback<List<ItemHistoricoVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemHistoricoVO>>) {
|
||||
_historicoList.value = response.body()?.let { ItemHistoricoListVO(it) }
|
||||
}
|
||||
|
||||
fun itemDiary(itemFk: Int, vWarehouseFk: Int) {
|
||||
silex.itemDiary(itemFk, vWarehouseFk).enqueue(object :
|
||||
SilexCallback<List<ItemHistoricoVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemHistoricoVO> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -36,25 +38,6 @@ class HistoricoArticuloViewModel(val context: Context) : BaseViewModel(context)
|
|||
)
|
||||
_historicoList.value = ItemHistoricoListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemHistoricoVO>>) {
|
||||
if (response.body() != null) {
|
||||
_historicoList.value = response.body()?.let { ItemHistoricoListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemHistoricoVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemHistoricoVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_historicoList.value = ItemHistoricoListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.lifecycle.Observer
|
||||
|
@ -13,19 +12,17 @@ import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
|||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.adapter.ItemShelvingLogAdapter
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class itemShelvingLogFragment(
|
||||
class ItemShelvingLogFragment(
|
||||
var entryPoint: String = ""
|
||||
// ) : BaseFragment<FragmentItemdayofsaleCardBinding, itemShelvingLogViewModel>(itemShelvingLogViewModel::class) {
|
||||
) : BaseFragment<FragmentItemshelvinglogBinding, itemShelvingLogViewModel>(itemShelvingLogViewModel::class) {
|
||||
//private lateinit var customDialogList: CustomDialogList
|
||||
) : BaseFragment<FragmentItemshelvinglogBinding, ItemShelvingLogViewModel>(ItemShelvingLogViewModel::class) {
|
||||
|
||||
private var adapter: ItemShelvingLogAdapter? = null
|
||||
private var itemScan = ""
|
||||
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint: String) = itemShelvingLogFragment(entryPoint)
|
||||
fun newInstance(entryPoint: String) = ItemShelvingLogFragment(entryPoint)
|
||||
}
|
||||
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -56,9 +53,9 @@ class itemShelvingLogFragment(
|
|||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!binding.scanInput.text.toString().isNullOrEmpty()) {
|
||||
itemShelvingLog_get(binding.scanInput.text.toString())
|
||||
|
||||
if (binding.scanInput.text.toString().isNotEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingLogGet(binding.scanInput.text.toString())
|
||||
itemScan = binding.scanInput.text.toString()
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
|
@ -68,90 +65,44 @@ class itemShelvingLogFragment(
|
|||
false
|
||||
}
|
||||
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
Log.d("VERDNATURA::","has vuelto")
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
private fun itemShelvingLog_get(vShelvingFK: String) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.itemShelvingLog_get(vShelvingFK)
|
||||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
/* loadItemShelvingLogList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
adapter = ItemShelvingLogAdapter(
|
||||
it.list,
|
||||
onPasillerosItemClickListener = pasillerosItemClickListener!!
|
||||
)
|
||||
binding.itemshelvinglogRecyclerview.adapter = adapter
|
||||
binding.itemshelvinglogRecyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
|
||||
|
||||
if (it.list.isEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.noResults))
|
||||
.setDescription(getString(R.string.noDataLabelScanned))
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
if (it.list.get(0).isError) {
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})*/
|
||||
|
||||
itemShelvingLogList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
adapter = ItemShelvingLogAdapter(
|
||||
it.list,
|
||||
onPasillerosItemClickListener = pasillerosItemClickListener!!
|
||||
)
|
||||
binding.itemshelvinglogRecyclerview.adapter = adapter
|
||||
binding.itemshelvinglogRecyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
adapter = ItemShelvingLogAdapter(
|
||||
it.list,
|
||||
onPasillerosItemClickListener = pasillerosItemClickListener!!
|
||||
)
|
||||
binding.itemshelvinglogRecyclerview.adapter = adapter
|
||||
binding.itemshelvinglogRecyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
setToolBar(getString(R.string.itemShelvingLog) + ":" + itemScan)
|
||||
|
||||
if (it.list.isEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.noResults))
|
||||
.setDescription(getString(R.string.noDataLabelScanned))
|
||||
if (it.list.isEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.noResults))
|
||||
.setDescription(getString(R.string.noDataLabelScanned))
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
if (it.list.get(0).isError) {
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
if (it.list.get(0).isError) {
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package es.verdnatura.presentation.view.feature.historicoshelving.fragment
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -14,45 +14,44 @@ import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelv
|
|||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLogList
|
||||
import retrofit2.Response
|
||||
|
||||
class itemShelvingLogViewModel(val context: Context) : BaseViewModel(context) {
|
||||
class ItemShelvingLogViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _itemShelvingLogList by lazy { MutableLiveData<ItemShelvingLogList>() }
|
||||
val itemShelvingLogList: LiveData<ItemShelvingLogList>
|
||||
get() = _itemShelvingLogList
|
||||
|
||||
get() = _itemShelvingLogList
|
||||
|
||||
val loadItemShelvingLogList = Transformations.map(_itemShelvingLogList) { Event(it) }
|
||||
|
||||
fun itemShelvingLogGet(vShelvingFK: String) {
|
||||
salix.itemShelvingLogGet(params = listOf(vShelvingFK).formatWithQuotes())
|
||||
.enqueue(object :
|
||||
SilexCallback<List<ItemShelvingLog>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
|
||||
if (response.body() != null) {
|
||||
_itemShelvingLogList.value = response.body()?.let {
|
||||
ItemShelvingLogList(it)
|
||||
}
|
||||
|
||||
fun itemShelvingLog_get(vShelvingFK: String) {
|
||||
silex.itemShelvingLog_get(vShelvingFK).enqueue(object :
|
||||
SilexCallback<List<ItemShelvingLog>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemShelvingLog> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingLog(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogList.value = ItemShelvingLogList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_itemShelvingLogList.value = response.body()?.let {
|
||||
ItemShelvingLogList(it)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemShelvingLog> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingLog(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogList.value = ItemShelvingLogList(listError)
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -86,36 +86,6 @@ class shelvingLogFragment(
|
|||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
/* loadShelvingLogList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
adapter = ShelvingLogAdapter(it.list)
|
||||
binding.itemshelvinglogRecyclerview.adapter = adapter
|
||||
binding.itemshelvinglogRecyclerview.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
setToolBar(getString(R.string.shelvingLog) + ":" + itemScan)
|
||||
|
||||
if (it.list.isEmpty()) {
|
||||
customDialog.setTitle(getString(R.string.noResults))
|
||||
.setDescription(getString(R.string.noDataLabelScanned))
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
|
||||
if (it.list.get(0).isError) {
|
||||
customDialog.setTitle(getString(R.string.error))
|
||||
.setDescription(it.list.get(0).errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
*/
|
||||
loadShelvingLogSalixList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
|
||||
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -11,7 +10,7 @@ import es.verdnatura.presentation.base.BaseFragment
|
|||
import es.verdnatura.presentation.view.feature.historicovehiculo.adapter.HistoricoVehiculoAdapter
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.Date
|
||||
|
||||
|
||||
class HistoricoVehiculoFragment(
|
||||
|
@ -32,8 +31,7 @@ class HistoricoVehiculoFragment(
|
|||
override fun init() {
|
||||
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
|
||||
viewModel.machineWorker_getHistorical(numberPlate)
|
||||
viewModel.machineWorkeGetHistorical(numberPlate,mobileApplication.userId!!)
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.vehiclediary)
|
||||
setEvents()
|
||||
super.init()
|
||||
|
|
|
@ -3,7 +3,8 @@ package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -17,41 +18,29 @@ class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context)
|
|||
private val _historicovehiculoList by lazy { MutableLiveData<ItemHistoricoVehiculoList>() }
|
||||
val loadHistoricoVehiculoList = Transformations.map(_historicovehiculoList) { Event(it) }
|
||||
|
||||
fun machineWorker_getHistorical(plateNumber: String) {
|
||||
silex.machineWorker_getHistorical(plateNumber).enqueue(object :
|
||||
SilexCallback<List<ItemHistoricoVehiculo>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemHistoricoVehiculo> = ArrayList()
|
||||
listError.add(
|
||||
ItemHistoricoVehiculo(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_historicovehiculoList.value = ItemHistoricoVehiculoList(listError)
|
||||
}
|
||||
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemHistoricoVehiculo>>) {
|
||||
if (response.body() != null) {
|
||||
salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
|
||||
.enqueue(object :
|
||||
SalixCallback<List<ItemHistoricoVehiculo>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemHistoricoVehiculo>>) {
|
||||
_historicovehiculoList.value =
|
||||
response.body()?.let { ItemHistoricoVehiculoList(it) }
|
||||
} else {
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemHistoricoVehiculo> = ArrayList()
|
||||
listError.add(
|
||||
ItemHistoricoVehiculo(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_historicovehiculoList.value = ItemHistoricoVehiculoList(listError)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import es.verdnatura.MobileApplication
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -64,14 +65,12 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseAddMistake: LiveData<ResponseItemVO>
|
||||
get() = _responseAddMistake
|
||||
|
||||
|
||||
private val _inventoryListParking by lazy { MutableLiveData<InventoryParkingList>() }
|
||||
val inventoryListParking: LiveData<InventoryParkingList>
|
||||
get() = _inventoryListParking
|
||||
|
||||
val loadInventaryParkingList = Transformations.map(_inventoryListParking) { Event(it) }
|
||||
|
||||
|
||||
private val _responseCode by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseCode: LiveData<ResponseItemVO>
|
||||
get() = _responseCode
|
||||
|
@ -85,7 +84,8 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<BuyerVO> = ArrayList()
|
||||
listError.add(
|
||||
BuyerVO(0,"",
|
||||
BuyerVO(
|
||||
0, "",
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
|
@ -99,7 +99,8 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
} else {
|
||||
val listError: ArrayList<BuyerVO> = ArrayList()
|
||||
listError.add(
|
||||
BuyerVO(0,"",
|
||||
BuyerVO(
|
||||
0, "",
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
|
@ -114,13 +115,16 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
val loadInventaryList = Transformations.map(_inventaryList) { Event(it) }
|
||||
|
||||
fun getInventory(buyerFk: Int, warehouseFk: Int) {
|
||||
silex.itemShelvingRadarFilterBuyer(buyerFk, warehouseFk)
|
||||
salix.itemShelvingFilterBuyer(params = arrayListOf(buyerFk, warehouseFk))
|
||||
.enqueue(object :
|
||||
SilexCallback<List<ItemInventaryVO>>(context) {
|
||||
SalixCallback<List<ItemInventaryVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemInventaryVO>>) {
|
||||
_inventaryList.value = response.body()?.let { InventaryListVO(it) }
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemInventaryVO> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -135,25 +139,6 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_inventaryList.value = InventaryListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemInventaryVO>>) {
|
||||
if (response.body() != null) {
|
||||
_inventaryList.value = response.body()?.let { InventaryListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemInventaryVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemInventaryVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_inventaryList.value = InventaryListVO(listError)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -163,7 +148,6 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
) {
|
||||
|
||||
|
||||
salix.itemShelvingUpdate(itemShelvingFk, params)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
||||
|
@ -188,7 +172,6 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
) {
|
||||
|
||||
|
||||
salix.itemShelvingsUpdate(where, params)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
||||
|
@ -214,26 +197,21 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
isTrash: Boolean
|
||||
) {
|
||||
|
||||
|
||||
silex.itemTrash(itemFk, warehouseFk, newValue, isTrash)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
||||
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!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun department_getHasMistake() {
|
||||
|
||||
salix.department_getHasMistake()
|
||||
|
@ -266,10 +244,15 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun worker_getFromHasMistake(departmentFk: Int) {
|
||||
silex.worker_getFromHasMistake(departmentFk)
|
||||
fun workerGetFromHasMistake(departmentFk: Int) {
|
||||
salix.workerGetFromHasMistake(arrayListOf(departmentFk))
|
||||
.enqueue(object :
|
||||
SilexCallback<List<WorkerFromMistake>>(context) {
|
||||
SalixCallback<List<WorkerFromMistake>>(context) {
|
||||
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
|
||||
_workerFromMistakeList.value =
|
||||
response.body()?.let { workerFromMistakeList(it) }
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<WorkerFromMistake> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -284,26 +267,6 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_workerFromMistakeList.value = workerFromMistakeList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<WorkerFromMistake>>) {
|
||||
if (response.body() != null) {
|
||||
|
||||
_workerFromMistakeList.value =
|
||||
response.body()?.let { workerFromMistakeList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<WorkerFromMistake> = ArrayList()
|
||||
listError.add(
|
||||
WorkerFromMistake(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_workerFromMistakeList.value = workerFromMistakeList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -349,14 +312,11 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
fun workerMistake_Add(
|
||||
|
||||
vUserFk: Int,
|
||||
vTypeFk: String
|
||||
) {
|
||||
//Tarea 5134
|
||||
salix.workerMistakesAdd(WorkerMistakeSalix(vUserFk,vTypeFk))
|
||||
salix.workerMistakesAdd(WorkerMistakeSalix(vUserFk, vTypeFk))
|
||||
.enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -367,7 +327,6 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
// sergio:refactor:solo debería haber un mensaje no un response o errorMessage
|
||||
_responseAddMistake.value =
|
||||
ResponseItemVO(
|
||||
isError = false,
|
||||
|
@ -384,7 +343,12 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
) {
|
||||
//Tarea 5134
|
||||
salix.expeditionMistakesAdd(
|
||||
ExpeditionMistakeSalix(expeditionFk = vExpeditionFk, typeFk = vTypeFk, workerFk = (context as MobileApplication).userId!!))
|
||||
ExpeditionMistakeSalix(
|
||||
expeditionFk = vExpeditionFk,
|
||||
typeFk = vTypeFk,
|
||||
workerFk = (context as MobileApplication).userId!!
|
||||
)
|
||||
)
|
||||
.enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -435,14 +399,14 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_inventoryListParking.value =
|
||||
response.body()?.let { InventoryParkingList(it) }
|
||||
|
||||
}else{
|
||||
} else {
|
||||
val listError: ArrayList<ItemInventoryParking> = ArrayList()
|
||||
listError.add(
|
||||
ItemInventoryParking(
|
||||
isError = false,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
response.message()
|
||||
),
|
||||
)
|
||||
)
|
||||
|
@ -588,7 +552,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
)
|
||||
// _inventoryListParking.value = myList
|
||||
// _inventoryListParking.value = myList
|
||||
|
||||
/*silex.itemShelving_inventory(vParkingFromFk, vParkingToFk)
|
||||
.enqueue(object :
|
||||
|
@ -672,9 +636,9 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
|||
errorMessage = context.getString(R.string.itemNotValid)
|
||||
)
|
||||
} else {
|
||||
println("itemCode response"+response.body())
|
||||
println("itemCode response string"+response.body().toString())
|
||||
println("itemCode response toInt"+response.body().toString().toInt())
|
||||
println("itemCode response" + response.body())
|
||||
println("itemCode response string" + response.body().toString())
|
||||
println("itemCode response toInt" + response.body().toString().toInt())
|
||||
|
||||
_responseCode.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!.toString())
|
||||
|
|
|
@ -324,11 +324,6 @@ class LoginFragment(var imageUri: Uri?) :
|
|||
|
||||
} else {
|
||||
//sergio: se añade el log
|
||||
viewModel.getCurrentUserData(
|
||||
getString(R.string.logAppName),
|
||||
getInfoVersionNameApp(),
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
|
||||
if (binding.switchRemember.isChecked) {
|
||||
saveRemember(true)
|
||||
|
@ -357,7 +352,7 @@ class LoginFragment(var imageUri: Uri?) :
|
|||
|
||||
}
|
||||
|
||||
/* workerId.observe(viewLifecycleOwner) {
|
||||
/* workerId.observe(viewLifecycleOwner) {
|
||||
if (!it.isError) {
|
||||
saveUserFkPref(it.Id.toString())
|
||||
}
|
||||
|
@ -385,26 +380,14 @@ class LoginFragment(var imageUri: Uri?) :
|
|||
}.show()
|
||||
}
|
||||
|
||||
viewModel.device_checkLogin(
|
||||
viewModel.getCurrentUserData(
|
||||
getString(R.string.logAppName),
|
||||
getInfoVersionNameApp(),
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
// viewModel.operator_getNumberOfWagons()
|
||||
}
|
||||
|
||||
/* operatorGetNumberOfWagons.observe(viewLifecycleOwner) {
|
||||
|
||||
if (!it.isError) {
|
||||
saveDataInt(NUMBEROFWAGONS, it.response!!)
|
||||
} else {
|
||||
customDialog.setTitle(getString(R.string.error)).setDescription(it.errorMessage)
|
||||
.setOkButton(getString(R.string.close)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
devicelogresponse.observe(viewLifecycleOwner) {
|
||||
|
||||
if (it.isError) {
|
||||
|
@ -419,41 +402,6 @@ class LoginFragment(var imageUri: Uri?) :
|
|||
}
|
||||
}
|
||||
|
||||
/* workergetSector.observe(viewLifecycleOwner) {
|
||||
//binding.splashProgress.visibility = View.GONE
|
||||
|
||||
|
||||
if (it.isError) {
|
||||
removeSector()
|
||||
} else {
|
||||
if (it.id != 0) {
|
||||
saveDataInt(SECTORFK, it.id)
|
||||
saveData(SECTORDESCRIP, it.description)
|
||||
it.warehouseFk?.let { it1 -> saveDataInt(WAREHOUSEFK, it1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* loadWorkerPrintList.observe(viewLifecycleOwner, Observer { event ->
|
||||
|
||||
event.getContentIfNotHandled().notNull {
|
||||
|
||||
if (it.list.isEmpty()) {
|
||||
getString(R.string.selectPrinter).toast(context)
|
||||
removePrinter()
|
||||
|
||||
} else {
|
||||
if (!it.list.get(0).isError) {
|
||||
saveDataInt(PRINTERFK, it.list[0].id)
|
||||
saveData(PRINTERNAME, it.list[0].name)
|
||||
} else {
|
||||
it.list.get(0).errorMessage.toast(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})*/
|
||||
|
||||
|
||||
loginSalixItem.observe(viewLifecycleOwner) {
|
||||
|
||||
|
@ -508,6 +456,7 @@ class LoginFragment(var imageUri: Uri?) :
|
|||
saveDataLong("renewPeriod", it.list[0].renewPeriod)
|
||||
saveDataLong("renewInterval", it.list[0].renewInterval)
|
||||
viewModel.operator_add()
|
||||
|
||||
} else {
|
||||
it.list[0].errorMessage.toast(context)
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@ import androidx.lifecycle.Transformations
|
|||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -31,7 +33,6 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val loginSalixItem: LiveData<LoginSalixVO>
|
||||
get() = _loginSalixItem
|
||||
|
||||
|
||||
private val _devicelogresponse by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val devicelogresponse: LiveData<ResponseItemVO>
|
||||
get() = _devicelogresponse
|
||||
|
@ -89,7 +90,6 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
_loginSalixItem.value = loginSalixVO
|
||||
|
@ -112,32 +112,20 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun device_checkLogin(android_id: String) {
|
||||
|
||||
silex.device_checkLogin(android_id)
|
||||
.enqueue(object : SilexCallback<LoginDevice>(context) {
|
||||
override fun onSuccess(response: Response<LoginDevice>) {
|
||||
if (response.body() != null) {
|
||||
|
||||
response.body()?.let {
|
||||
|
||||
_logindevice.value = LoginDevice(
|
||||
it.vMessage, it.vIsAuthorized,
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
)
|
||||
|
||||
}
|
||||
} else {
|
||||
fun deviceCheckLogin(userId: Int, androidId: String) {
|
||||
// FALTA EL USUARI
|
||||
/* fun deviceCheckLogin(androidId: String) {
|
||||
silex.device_checkLogin(androidId)*/
|
||||
salix.deviceCheckLogin(arrayListOf(userId, androidId).formatWithQuotes())
|
||||
.enqueue(object : SalixCallback<List<LoginDevice>>(context) {
|
||||
override fun onSuccess(response: Response<List<LoginDevice>>) {
|
||||
response.body()?.get(0).let {
|
||||
_logindevice.value = LoginDevice(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
it!!.vMessage, it.vIsAuthorized,
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -174,6 +162,7 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
//Tarea 5870
|
||||
operator_getDataSalix(app.userId!!)
|
||||
deviceCheckLogin(app.userId!!, android_id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -401,7 +390,6 @@ class LoginViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.main.activity
|
||||
|
||||
|
||||
import NetworkUtils
|
||||
import PhotosFragment
|
||||
import android.content.Intent
|
||||
|
@ -50,7 +49,7 @@ import es.verdnatura.presentation.view.feature.delivery.fragments.TicketsFragmen
|
|||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicket
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.itemShelvingLogFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.ItemShelvingLogFragment
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.shelvingLogFragment
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoFragment
|
||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryFragment
|
||||
|
@ -90,13 +89,13 @@ import kotlinx.coroutines.DelicateCoroutinesApi
|
|||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber.d
|
||||
import java.util.Date
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.ScheduledExecutorService
|
||||
import java.util.concurrent.ScheduledFuture
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickListener,
|
||||
OnTruckClickListener, OnPalletClickListener, OnComprobarPalletViewClickListener,
|
||||
OnCollectionSelectedListener, OnCollectionTicketSelectedListener {
|
||||
|
@ -113,7 +112,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
private val _renewTokenResponse = MutableLiveData<RenewToken>()
|
||||
private lateinit var networkUtils: NetworkUtils
|
||||
|
||||
|
||||
//Tarea #4815
|
||||
private var myTimeUserInteraction = (System.currentTimeMillis() / 1000 / 3600)
|
||||
private var comeFromDelivery: Boolean? = null
|
||||
|
@ -165,7 +163,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
str =
|
||||
"$str<HTML><div><div style=\"float:left;\"><b>This is left</b></div><div style=\"float:right;font-size:15px;\">This is right</div></div>"
|
||||
|
||||
|
||||
val sendIntent = Intent()
|
||||
sendIntent.action = Intent.ACTION_SEND
|
||||
sendIntent.setPackage("mate.bluetoothprint")
|
||||
|
@ -200,7 +197,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
scheduledExecutor?.shutdown()
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun setFragments() {
|
||||
try {
|
||||
|
@ -288,7 +284,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//Tarea 5613
|
||||
startRepeatingTask(
|
||||
|
@ -426,7 +421,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
// Add al items to menu view
|
||||
bottomMenuItems.forEach {
|
||||
bottomMenu.menu.add(Menu.NONE, it.id, Menu.NONE, it.title).icon = it.defaultImage
|
||||
|
@ -461,7 +455,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
when (selectedItemMenu?.title) {
|
||||
|
||||
|
||||
getString(R.string.titleCorridors) -> {
|
||||
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
delete_Fragments()
|
||||
|
@ -496,7 +489,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
false
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
getString(R.string.Ajustes) -> {
|
||||
|
@ -510,7 +502,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
true
|
||||
|
@ -555,7 +546,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
when (item.title) {
|
||||
|
||||
|
||||
//BUFFERS
|
||||
getString(R.string.titlePalletizar) -> {
|
||||
addFragmentOnTop(ExpeditionTruckListFragment.newInstance())
|
||||
|
@ -651,15 +641,12 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
getString(R.string.titleHistoricalVehicle) -> {
|
||||
addFragmentOnTop(ControlVehiculoFragment.newInstance(HistoricoVehiculoFragment.TAG))
|
||||
// fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
// addFragment(HistoricoVehiculoFragment.newInstance(entryPoint),R.id.main_frame_layout, ControladorFragment.TAG,false)
|
||||
}
|
||||
|
||||
getString(R.string.titleItemConsult) -> {
|
||||
println("La sale queda pasada con $entryPoint")
|
||||
addFragmentOnTop(ItemCardFragment.newInstance(entryPoint))
|
||||
}
|
||||
//sergio:no visible desde el menú inicio
|
||||
|
||||
getString(R.string.titleSearchSimilarItems) -> {
|
||||
addFragmentOnTop(ItemProposalFragment.newInstance(entryPoint.toInt()))
|
||||
}
|
||||
|
@ -698,7 +685,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(UbicadorFragment.newInstance(entryPoint))
|
||||
}
|
||||
|
||||
getString(R.string.titleAuto) -> {
|
||||
getString(R.string.titleAuto) -> {
|
||||
addFragmentOnTop(AutomaticAddItemFragmentTEST.newInstance(entryPoint, item.title))
|
||||
}
|
||||
|
||||
|
@ -706,7 +693,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(AutomaticAddItemFragment.newInstance(entryPoint, item.title))
|
||||
}
|
||||
|
||||
|
||||
getString(R.string.titlePickers) -> {
|
||||
//addFragmentOnTop(SacadorFragment.newInstance())
|
||||
addFragmentOnTop(ControlVehiculoFragment.newInstance(""))
|
||||
|
@ -756,7 +742,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}
|
||||
|
||||
getString(R.string.titleShelvingHistorical) -> {
|
||||
addFragmentOnTop(itemShelvingLogFragment.newInstance(item.title))
|
||||
addFragmentOnTop(ItemShelvingLogFragment.newInstance(item.title))
|
||||
|
||||
}
|
||||
|
||||
|
@ -824,12 +810,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
addFragmentOnTop(
|
||||
RoutesFragment.newInstance(getString(R.string.titleDeliveryRoute)),
|
||||
getString(R.string.titleDeliverySummary)
|
||||
getString(R.string.titleDeliverySummary)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
getString(R.string.titleInfo) -> {
|
||||
addFragmentOnTop(
|
||||
InfoFragment.newInstance(item.title),
|
||||
|
@ -861,7 +846,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
if (comeFromDelivery == true) {
|
||||
getString(R.string.titleLoadTruck)
|
||||
} else {
|
||||
null
|
||||
getString(R.string.titleLoadTruck)
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -883,7 +868,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
if (comeFromDelivery == true) {
|
||||
getString(R.string.titleUnLoadTruck)
|
||||
} else {
|
||||
null
|
||||
getString(R.string.titleUnLoadTruck)
|
||||
}, delete = true
|
||||
)
|
||||
|
||||
|
@ -970,12 +955,37 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
var backEntry = ""
|
||||
if (index >= 0) {
|
||||
backEntry = supportFragmentManager.getBackStackEntryAt(index).name.toString()
|
||||
|
||||
if (backEntry.contains(getString(R.string.titleLoadTruck)) || backEntry.contains(
|
||||
getString(R.string.titleUnLoadTruck)
|
||||
)
|
||||
) {
|
||||
if (LoadUnloadFragment.scanned) {
|
||||
customDialog.setTitle(getString(R.string.packagesNotScanned))
|
||||
.setDescription(getString(R.string.savePackages))
|
||||
.setOkButton(getString(R.string.yes)) {
|
||||
customDialog.dismiss()
|
||||
}.setKoButton(getString(R.string.no)) {
|
||||
backStackFragments(backEntry)
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
||||
} else {
|
||||
backStackFragments(backEntry)
|
||||
}
|
||||
} else {
|
||||
backStackFragments(backEntry)
|
||||
}
|
||||
} else {
|
||||
backStackFragments(backEntry)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun backStackFragments(backEntry: String) {
|
||||
try {
|
||||
fm.executePendingTransactions()
|
||||
} catch (e: Exception) {
|
||||
} catch (ex: Exception) {
|
||||
d("${ex.message}")
|
||||
}
|
||||
|
||||
if (fm.backStackEntryCount > 0) {
|
||||
|
@ -995,6 +1005,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
) {
|
||||
finish()
|
||||
}
|
||||
|
||||
} else {
|
||||
customDialog.setTitle(getString(R.string.closeSession))
|
||||
.setDescription(getString(R.string.sureCloseSession))
|
||||
|
@ -1009,12 +1020,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
}.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTruckClickListener(item: ItemExpeditionTruckVO, entryPoint: String) {
|
||||
//Log.d("VERDNATURA","Pulsdo item"+item.truckFk)
|
||||
addFragmentOnTop(ExpeditionPalletFragment.newInstance(item))
|
||||
|
||||
}
|
||||
|
@ -1027,7 +1036,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(ExpeditionScanFragment.newInstance(itemTruck, itemPallet))
|
||||
}
|
||||
|
||||
|
||||
override fun onComprobarPalletViewClickListener(
|
||||
itemTruck: ItemExpeditionTruckVO,
|
||||
itemPallet: ItemPalletVO
|
||||
|
@ -1079,13 +1087,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
addFragmentOnTop(CollectionFragmentPicker.newInstance(collection, type))
|
||||
}
|
||||
|
||||
|
||||
else -> {
|
||||
addFragmentOnTop(CollectionFragment.newInstance(collection, type))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//sergio:se llama al pulsar sobre el coche IN desde Sacador
|
||||
|
@ -1125,7 +1131,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
SacadorFragment.TAG,
|
||||
true
|
||||
|
||||
|
||||
)
|
||||
//addFragmentOnTop(SacadorFragment.newInstance())
|
||||
|
||||
|
@ -1143,7 +1148,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
SacadorFragment.TAG,
|
||||
true
|
||||
|
||||
|
||||
)
|
||||
//addFragmentOnTop(SacadorFragment.newInstance())
|
||||
|
||||
|
@ -1168,7 +1172,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
binding.mainBottomNavigation.visibility = visible
|
||||
}
|
||||
|
||||
|
||||
fun messageWithSound(
|
||||
message: String,
|
||||
isError: Boolean?,
|
||||
|
@ -1199,7 +1202,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
mpErrorRepeat?.start()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*Tarea 4815*/
|
||||
|
@ -1219,11 +1221,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
//Tarea 5613
|
||||
//Tarea 5613
|
||||
fun checkTokenRenew() {
|
||||
val prefs = (application as MobileApplication).getPrefsShared()
|
||||
val renewPeriod = prefs.getLong("renewPeriod", 0)
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
package es.verdnatura.presentation.view.feature.modelViewModel
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposalList
|
||||
import retrofit2.Response
|
||||
|
||||
class FragmentsViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val _responseCallBack by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseCallBack: LiveData<ResponseItemVO>
|
||||
get() = _responseCallBack
|
||||
|
||||
|
||||
fun callBackFuncSalix(routine: String, params: ArrayList<Any>) {
|
||||
salix.executeFunc(
|
||||
routine = routine, params = params
|
||||
).enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseCallBack.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse((routine), t.message!!),
|
||||
routine = routine
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_responseCallBack.value = ResponseItemVO(
|
||||
isError = false,
|
||||
response = response.body()!!.toString(),
|
||||
errorMessage = "",
|
||||
routine = routine
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
fun callBackProcedSalix(routine: String, params: ArrayList<Any>) {
|
||||
salix.executeProc(
|
||||
routine = routine, params = params
|
||||
).enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseCallBack.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse((routine), t.message!!),
|
||||
routine = routine
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_responseCallBack.value = ResponseItemVO(
|
||||
isError = false,
|
||||
response = if (response.body()!=null){response.body()!!.toString()}else{""},
|
||||
errorMessage = "",
|
||||
routine = routine,
|
||||
data = response.body()?.let {
|
||||
ItemProposalList(it as List<ItemProposal>)
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
|
@ -21,7 +21,6 @@ import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMis
|
|||
import es.verdnatura.presentation.view.feature.workermistake.model.MistakeType
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class PackagingSummaryFragment(
|
||||
var entryPoint: String = ""
|
||||
|
@ -34,7 +33,6 @@ class PackagingSummaryFragment(
|
|||
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
|
||||
|
||||
private var listWorker: MutableList<WorkerFromMistake> = ArrayList()
|
||||
private var listWorkerAuxiliary: MutableList<WorkerFromMistake> = ArrayList()
|
||||
private lateinit var customDialog: CustomDialog
|
||||
|
@ -46,7 +44,6 @@ class PackagingSummaryFragment(
|
|||
private var listMistakesAdapter: BarcodeAdapter? = null
|
||||
private var workerMistakeName: WorkerFromMistake? = null
|
||||
|
||||
|
||||
private val departments = ArrayList<SearchDepartmentModel>()
|
||||
private lateinit var departmentId: String
|
||||
|
||||
|
@ -56,24 +53,19 @@ class PackagingSummaryFragment(
|
|||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_packaging_summary
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
binding.totalImages.text = getData("ENTRYNUMBERIMAGES")
|
||||
binding.observations.text = getData("ENTRYOBSERVATIONS")
|
||||
|
||||
departmentId = getData(DEPARTMENTMISTAKEID)
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
|
||||
|
||||
|
||||
if (!departmentId.isEmpty()) {
|
||||
viewModel.worker_getFromHasMistake(
|
||||
viewModel.workerGetFromHasMistake(
|
||||
getData(DEPARTMENTMISTAKEID).toInt()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
customDialogInput = CustomDialogInput(requireContext())
|
||||
customDialog = CustomDialog(requireContext())
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
|
@ -113,18 +105,15 @@ class PackagingSummaryFragment(
|
|||
|
||||
private fun setEvents() {
|
||||
|
||||
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
|
||||
mistakeDepartmentList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createDepartmentList(it.list)
|
||||
|
@ -149,7 +138,6 @@ class PackagingSummaryFragment(
|
|||
""
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
binding.workermistakeRecyclerview.adapter = adapterworker
|
||||
|
@ -168,7 +156,6 @@ class PackagingSummaryFragment(
|
|||
|
||||
responseAddMistake.observe(viewLifecycleOwner, {
|
||||
|
||||
|
||||
ma.messageWithSound(
|
||||
if (it.isError) {
|
||||
if (it.codeError == 403) {
|
||||
|
@ -193,7 +180,6 @@ class PackagingSummaryFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showMistakeList(list: List<MistakeType>) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
listMistakes = ArrayList()
|
||||
|
@ -236,7 +222,6 @@ class PackagingSummaryFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
private fun createDepartmentList(list: List<DepartmentMistake>) {
|
||||
departments.clear()
|
||||
list.forEach { department ->
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
||||
|
||||
import android.text.InputType
|
||||
import android.view.View.*
|
||||
import android.view.View.GONE
|
||||
import android.view.View.INVISIBLE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentGeneralBlackBinding
|
||||
|
@ -119,7 +121,7 @@ class PackingHollandFragment(var entrypoint: String) :
|
|||
ma.hideKeyboard(customDialogInput.getEditText())
|
||||
customDialogInput.dismiss()
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.travel_updatePacking(
|
||||
viewModel.travelUpdatePacking(
|
||||
itemFk = shelvingScaned,
|
||||
packingFk = value.toInt()
|
||||
)
|
||||
|
|
|
@ -4,7 +4,7 @@ package es.verdnatura.presentation.view.feature.packingHolland.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -18,12 +18,16 @@ class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
|
|||
get() = _response
|
||||
|
||||
|
||||
fun travel_updatePacking(
|
||||
fun travelUpdatePacking(
|
||||
itemFk: Int,
|
||||
packingFk: Int
|
||||
) {
|
||||
silex.travel_updatePacking(itemFk, packingFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.travelUpdatePacking(arrayListOf(itemFk, packingFk))
|
||||
.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,
|
||||
|
@ -31,11 +35,6 @@ class PackingHollandViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class CmrExpeditionPalletFragment(
|
|||
|
||||
customDialogList.dismiss()
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.cmrExpeditionPallet_add(
|
||||
viewModel.cmrExpeditionPalletAdd(
|
||||
vExpeditionPallet!!,
|
||||
vCmrId!!
|
||||
)
|
||||
|
|
|
@ -3,41 +3,34 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class CmrExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val _responsescan by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responsescan: LiveData<ResponseItemVO>
|
||||
get() = _responsescan
|
||||
|
||||
fun cmrExpeditionPalletAdd(vExpeditionPallet: Int, cmrFk: Int) {
|
||||
salix.cmrPalletAdd(arrayListOf(vExpeditionPallet, cmrFk))
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_responsescan.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
fun cmrExpeditionPallet_add(vExpeditionPallet: Int, cmrFk: Int) {
|
||||
silex.cmrExpeditionPallet_add(vExpeditionPallet, cmrFk)
|
||||
.enqueue(object : SilexCallback<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()!!)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -20,7 +20,7 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionT
|
|||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewListVO
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.Calendar
|
||||
|
||||
class ExpeditionPalletDetailFragment(
|
||||
var itemExpeditionTruckVO: ItemExpeditionTruckVO? = null,
|
||||
|
@ -56,7 +56,7 @@ class ExpeditionPalletDetailFragment(
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
|
||||
itemExpeditionTruckVO!!.eta.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrEmpty()) {
|
||||
|
||||
itemExpeditionTruckVO!!.description
|
||||
}else{
|
||||
|
@ -65,7 +65,7 @@ class ExpeditionPalletDetailFragment(
|
|||
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionPallet_List(
|
||||
viewModel.expeditionPalletView(
|
||||
itemPallet!!.Pallet
|
||||
)
|
||||
super.init()
|
||||
|
@ -101,7 +101,7 @@ class ExpeditionPalletDetailFragment(
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(
|
||||
viewModel.expeditionPalletView(
|
||||
itemPallet!!.Pallet
|
||||
)
|
||||
} else if (item == iconEditar) {
|
||||
|
@ -181,7 +181,7 @@ class ExpeditionPalletDetailFragment(
|
|||
|
||||
} else {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionState_addByPallet(
|
||||
viewModel.expeditionStateAddByPallet(
|
||||
itemPallet!!.Pallet,
|
||||
"PALLETIZED"
|
||||
)
|
||||
|
|
|
@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -17,8 +18,6 @@ import retrofit2.Response
|
|||
|
||||
class ExpeditionPalletDetailViewModel(var context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
|
||||
private val _expeditionPalletList by lazy { MutableLiveData<ItemPalletViewListVO>() }
|
||||
val loadExpeditionPalletList = Transformations.map(_expeditionPalletList) { Event(it) }
|
||||
|
||||
|
@ -30,47 +29,47 @@ class ExpeditionPalletDetailViewModel(var context: Context) : BaseViewModel(cont
|
|||
val responsePrintPallet: LiveData<ResponseItemVO>
|
||||
get() = _responsePrintPallet
|
||||
|
||||
fun expeditionPalletView(vPalletFk: Int) {
|
||||
salix.expeditionPalletView(arrayListOf(vPalletFk))
|
||||
.enqueue(object :
|
||||
SalixCallback<List<ItemPalletViewVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemPalletViewVO>>) {
|
||||
if (response.body() != null) {
|
||||
_expeditionPalletList.value =
|
||||
response.body()?.let { ItemPalletViewListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemPalletViewVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemPalletViewVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_expeditionPalletList.value = ItemPalletViewListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
fun expeditionPallet_List(vPalletFk: Int) {
|
||||
silex.expeditionPalletView(vPalletFk).enqueue(object :
|
||||
SilexCallback<List<ItemPalletViewVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemPalletViewVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemPalletViewVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_expeditionPalletList.value = ItemPalletViewListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemPalletViewVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_expeditionPalletList.value = response.body()?.let { ItemPalletViewListVO(it) }
|
||||
} else {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemPalletViewVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemPalletViewVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_expeditionPalletList.value = ItemPalletViewListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionPalletDel(vPalletFk: Int) {
|
||||
//Tarea 5134
|
||||
salix.expeditionPalletDel(vPalletFk).enqueue(object : SalixCallback<Any>(context) {
|
||||
//silex.expeditionPalletDel(vPalletFk).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -79,13 +78,13 @@ class ExpeditionPalletDetailViewModel(var context: Context) : BaseViewModel(cont
|
|||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
_response.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -94,40 +93,41 @@ class ExpeditionPalletDetailViewModel(var context: Context) : BaseViewModel(cont
|
|||
vPalletFk: Int,
|
||||
vSectorFk: Int
|
||||
) {
|
||||
|
||||
silex.expeditionPalletPrintSet(vPalletFk, vSectorFk).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responsePrintPallet.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
salix.expeditionPalletPrintLabel(arrayListOf(vPalletFk, vSectorFk))
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responsePrintPallet.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responsePrintPallet.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionState_addByPallet(
|
||||
fun expeditionStateAddByPallet(
|
||||
vPalletFk: Int,
|
||||
vStateCode: String,
|
||||
) {
|
||||
|
||||
silex.expeditionState_addByPallet(vPalletFk, vStateCode).enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
salix.expeditionStateAddByPallet(
|
||||
arrayListOf(vPalletFk, vStateCode).formatWithQuotes()
|
||||
)
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -76,7 +76,7 @@ class ExpeditionPalletFragment(
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||
itemExpeditionTruckVO!!.eta.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||
itemExpeditionTruckVO!!.description
|
||||
|
||||
} else {
|
||||
|
@ -84,8 +84,8 @@ class ExpeditionPalletFragment(
|
|||
}
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.expeditionPallet_List(
|
||||
itemExpeditionTruckVO!!.truckFk
|
||||
viewModel.expeditionPalletList(
|
||||
itemExpeditionTruckVO!!.id
|
||||
)
|
||||
|
||||
super.init()
|
||||
|
@ -111,8 +111,8 @@ class ExpeditionPalletFragment(
|
|||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(
|
||||
itemExpeditionTruckVO!!.truckFk
|
||||
viewModel.expeditionPalletList(
|
||||
itemExpeditionTruckVO!!.id
|
||||
)
|
||||
} else if (item == iconPlus) {
|
||||
expeditionScanAdd()
|
||||
|
@ -184,7 +184,8 @@ class ExpeditionPalletFragment(
|
|||
private fun expeditionScanAdd() {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanAdd(
|
||||
vPalletFk = 0, vTruckFk = itemExpeditionTruckVO!!.truckFk
|
||||
vPalletFk = 0,
|
||||
vTruckFk = itemExpeditionTruckVO!!.id
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -227,8 +228,8 @@ class ExpeditionPalletFragment(
|
|||
}.setKoButton(getString(R.string.close)) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionPallet_List(
|
||||
itemExpeditionTruckVO!!.truckFk
|
||||
viewModel.expeditionPalletList(
|
||||
itemExpeditionTruckVO!!.id
|
||||
)
|
||||
listExpeditions = ArrayList()
|
||||
customDialogList.dismiss()
|
||||
|
@ -249,7 +250,7 @@ class ExpeditionPalletFragment(
|
|||
it.list.get(0).palletFk,
|
||||
customDialogList.getValue().toInt()
|
||||
)
|
||||
viewModel.checkRouteExpeditionScanPut(
|
||||
viewModel.expeditionCheckRoute(
|
||||
it.list[0].palletFk,
|
||||
customDialogList.getValue().toInt()
|
||||
)
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -19,11 +19,9 @@ import retrofit2.Response
|
|||
|
||||
class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val _expeditionPalletList by lazy { MutableLiveData<ItemPalletListVO>() }
|
||||
val loadExpeditionPalletList = Transformations.map(_expeditionPalletList) { Event(it) }
|
||||
|
||||
|
||||
private val _scanList by lazy { MutableLiveData<ItemScanList>() }
|
||||
val loadScanList = Transformations.map(_scanList) { Event(it) }
|
||||
|
||||
|
@ -36,26 +34,33 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseCheckexpeditionScanPut: LiveData<ResponseItemVO>
|
||||
get() = _responseCheckexpeditionScanPut
|
||||
|
||||
fun expeditionPalletList(vTruckFk: Int) {
|
||||
salix.expeditionPalletList(
|
||||
arrayListOf(vTruckFk)
|
||||
)
|
||||
.enqueue(object :
|
||||
SalixCallback<List<ItemPalletVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemPalletVO>>) {
|
||||
if (response.body() != null) {
|
||||
_expeditionPalletList.value =
|
||||
response.body()?.let { ItemPalletListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemPalletVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemPalletVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_expeditionPalletList.value = ItemPalletListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
fun expeditionPallet_List(vTruckFk: Int) {
|
||||
silex.expeditionPallet_List(vTruckFk).enqueue(object :
|
||||
SilexCallback<List<ItemPalletVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemPalletVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemPalletVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_expeditionPalletList.value = ItemPalletListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemPalletVO>>) {
|
||||
if (response.body() != null) {
|
||||
_expeditionPalletList.value = response.body()?.let { ItemPalletListVO(it) }
|
||||
} else {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemPalletVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemPalletVO(
|
||||
|
@ -63,37 +68,43 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
|||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_expeditionPalletList.value = ItemPalletListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionScanAdd(vPalletFk: Int, vTruckFk: Int) {
|
||||
silex.expeditionScanAdd(vPalletFk, vTruckFk).enqueue(object :
|
||||
SilexCallback<List<ItemScanVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemScanVO(
|
||||
"",
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_scanList.value = ItemScanList(listError)
|
||||
}
|
||||
salix.expeditionScanAdd(
|
||||
arrayListOf(vPalletFk, vTruckFk)
|
||||
)
|
||||
.enqueue(object :
|
||||
SalixCallback<List<ItemScanVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemScanVO>>) {
|
||||
if (response.body() != null) {
|
||||
_scanList.value = response.body()?.let { ItemScanList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemScanVO(
|
||||
"",
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_scanList.value = ItemScanList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemScanVO>>) {
|
||||
if (response.body() != null) {
|
||||
_scanList.value = response.body()?.let { ItemScanList(it) }
|
||||
} else {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemScanVO(
|
||||
|
@ -102,47 +113,36 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
|||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_scanList.value = ItemScanList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionScanPut(vPalletFk: Int, vExpeditionFk: Int) {
|
||||
silex.expeditionScanPut(vPalletFk, vExpeditionFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun checkRouteExpeditionScanPut(vPalletFk: Int, vExpeditionFk: Int) {
|
||||
silex.checkRouteExpeditionScanPut(vPalletFk, vExpeditionFk)
|
||||
.enqueue(object : SilexCallback<String>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
fun expeditionScanPut(vPalletFk: Int, vExpeditionFk: Int) {
|
||||
salix.expeditionScanPut(arrayListOf(vPalletFk, vExpeditionFk))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onResponse(call: Call<Any>, 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 expeditionCheckRoute(vPalletFk: Int, vExpeditionFk: Int) {
|
||||
salix.expeditionCheckRoute(arrayListOf(vPalletFk, vExpeditionFk))
|
||||
.enqueue(object : SalixCallback<String>(context) {
|
||||
override fun onSuccess(response: Response<String>) {
|
||||
//sergio: espera repuesta en el body
|
||||
if (response.body() == null) {
|
||||
_responseCheckexpeditionScanPut.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -157,8 +157,14 @@ class ExpeditionPalletViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class ExpeditionScanFragment(
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
ma.hideBottomNavigation(View.GONE)
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
itemExpeditionTruckVO!!.ETD.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||
itemExpeditionTruckVO!!.eta.toString() + " " + if (itemExpeditionTruckVO!!.Destino.isNullOrBlank()) {
|
||||
itemExpeditionTruckVO!!.description
|
||||
} else {
|
||||
|
||||
|
@ -204,7 +204,7 @@ class ExpeditionScanFragment(
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionScanAdd(
|
||||
vPalletFk = itemPalletVO!!.Pallet,
|
||||
vTruckFk = itemExpeditionTruckVO!!.truckFk
|
||||
vTruckFk = itemExpeditionTruckVO!!.id
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
import android.view.View.*
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentExpeditionscanSorterBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
import es.verdnatura.presentation.common.GeneralAdapter
|
||||
import es.verdnatura.presentation.common.GeneralItem
|
||||
import es.verdnatura.presentation.common.OnGeneralItemRowClickListener
|
||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
||||
|
||||
|
||||
|
@ -45,7 +48,7 @@ class ExpeditionScanSorterFragment(
|
|||
private fun expeditionscan(expeditionScan: String) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.expedition_scan(expeditionScan)
|
||||
viewModel.expeditionScan(expeditionScan)
|
||||
itemScaned = expeditionScan
|
||||
|
||||
}
|
||||
|
|
|
@ -3,12 +3,11 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
@ -17,20 +16,10 @@ class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(contex
|
|||
val responsescan: LiveData<ResponseItemVO>
|
||||
get() = _responsescan
|
||||
|
||||
|
||||
fun expedition_scan(vExpeditionId: String) {
|
||||
silex.expedition_scan(vExpeditionId)
|
||||
.enqueue(object : Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
|
||||
_responsescan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Unit>, response: Response<Unit>) {
|
||||
|
||||
fun expeditionScan(vExpeditionId: String) {
|
||||
salix.expeditionScan(params = arrayListOf(vExpeditionId))
|
||||
.enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
if (!response.isSuccessful) {
|
||||
_responsescan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -46,8 +35,14 @@ class ExpeditionScanSorterViewModel(val context: Context) : BaseViewModel(contex
|
|||
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responsescan.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
|
@ -18,11 +19,9 @@ import retrofit2.Response
|
|||
|
||||
class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val _expeditionScanList by lazy { MutableLiveData<ItemExpeditionScanList>() }
|
||||
val loadExpeditionScanList = Transformations.map(_expeditionScanList) { Event(it) }
|
||||
|
||||
|
||||
private val _scanList by lazy { MutableLiveData<ItemScanList>() }
|
||||
val loadScanList = Transformations.map(_scanList) { Event(it) }
|
||||
|
||||
|
@ -38,52 +37,35 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseCheckexpeditionScanPut: LiveData<ResponseItemVO>
|
||||
get() = _responseCheckexpeditionScanPut
|
||||
|
||||
|
||||
fun expeditionScanList(vPalletFk: Int) {
|
||||
silex.expeditionScanList(vPalletFk).enqueue(object :
|
||||
SilexCallback<List<ItemExpeditionScanVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemExpeditionScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemExpeditionScanVO(0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_expeditionScanList.value = ItemExpeditionScanList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemExpeditionScanVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_expeditionScanList.value = response.body()?.let { ItemExpeditionScanList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemExpeditionScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemExpeditionScanVO(0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
salix.expeditionScanList(arrayListOf(vPalletFk))
|
||||
.enqueue(object :
|
||||
SalixCallback<List<ItemExpeditionScanVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemExpeditionScanVO>>) {
|
||||
if (response.body() != null) {
|
||||
_expeditionScanList.value =
|
||||
response.body()?.let { ItemExpeditionScanList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemExpeditionScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemExpeditionScanVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
_expeditionScanList.value = ItemExpeditionScanList(listError)
|
||||
_expeditionScanList.value = ItemExpeditionScanList(listError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionScanAdd(vPalletFk: Int, vTruckFk: Int) {
|
||||
silex.expeditionScanAdd(vPalletFk, vTruckFk)
|
||||
.enqueue(object :
|
||||
SilexCallback<List<ItemScanVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemScanVO> = ArrayList()
|
||||
val listError: ArrayList<ItemExpeditionScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemScanVO(
|
||||
"", 0,
|
||||
ItemExpeditionScanVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
|
@ -91,11 +73,17 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
)
|
||||
_scanList.value = ItemScanList(listError)
|
||||
_expeditionScanList.value = ItemExpeditionScanList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemScanVO>>) {
|
||||
})
|
||||
}
|
||||
|
||||
fun expeditionScanAdd(vPalletFk: Int, vTruckFk: Int) {
|
||||
salix.expeditionScanAdd(arrayListOf(vPalletFk, vTruckFk))
|
||||
.enqueue(object :
|
||||
SilexCallback<List<ItemScanVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemScanVO>>) {
|
||||
if (response.body() != null) {
|
||||
_scanList.value = response.body()?.let { ItemScanList(it) }
|
||||
} else {
|
||||
|
@ -114,6 +102,20 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemScanVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemScanVO(
|
||||
"", 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_scanList.value = ItemScanList(listError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -121,8 +123,16 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
vPalletFk: Int,
|
||||
vExpeditionFk: Int
|
||||
) {
|
||||
silex.expeditionScanPut(vPalletFk, vExpeditionFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.expeditionScanPut(
|
||||
arrayListOf(vPalletFk, vExpeditionFk)
|
||||
)
|
||||
.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(
|
||||
|
@ -130,13 +140,6 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -144,20 +147,13 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
vPalletFk: Int,
|
||||
vExpeditionFk: Int
|
||||
) {
|
||||
silex.checkRouteExpeditionScanPut(
|
||||
vPalletFk,
|
||||
vExpeditionFk
|
||||
).enqueue(object : SilexCallback<String>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_responseCheckexpeditionScanPut.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
salix.expeditionCheckRoute(
|
||||
arrayListOf(
|
||||
vPalletFk,
|
||||
vExpeditionFk
|
||||
)
|
||||
).enqueue(object : SalixCallback<String>(context) {
|
||||
override fun onSuccess(response: Response<String>) {
|
||||
//sergio:se devuelve en el body
|
||||
if (response.body() == null) {
|
||||
_responseCheckexpeditionScanPut.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -172,15 +168,22 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseCheckexpeditionScanPut.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun expeditionScanDel( vScanFk: Int) {
|
||||
fun expeditionScanDel(vScanFk: Int) {
|
||||
//Tarea 5134 // no se cambia hasta que se suba test→master 11-17-23
|
||||
//salix.expeditionScanDel(vScanFk).enqueue(object : SalixCallback<Any>(context){
|
||||
silex.expeditionScanDel(vScanFk)
|
||||
.enqueue(object : SilexCallback<Any> (context){
|
||||
salix.expeditionScanDel(vScanFk)
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
//silex.expeditionScanDel(vScanFk)
|
||||
//.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseDeleteScan.value = ResponseItemVO(
|
||||
isError = true, errorMessage = getMessageFromAllResponse(
|
||||
|
@ -191,9 +194,9 @@ class ExpeditionScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_responseDeleteScan.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
_responseDeleteScan.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ class ExpeditionStateFragment(
|
|||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
itemexpedition.observe(viewLifecycleOwner, {
|
||||
itemexpedition.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
binding.itemcardLayout.visibility = View.GONE
|
||||
|
@ -85,7 +85,7 @@ class ExpeditionStateFragment(
|
|||
} else {
|
||||
setItemExpeditionState(it)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
|
||||
//import es.verdnatura.presentation.view.feature.paletizador.model.itemExpeditionDynamicsList
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
|
@ -8,6 +7,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -16,11 +16,8 @@ import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
|||
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingTypeList
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.itemExpedetionState
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.itemsExpeditionDynamics
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _itemcard by lazy { MutableLiveData<ItemCardVO>() }
|
||||
|
@ -31,12 +28,10 @@ class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val itemexpeditionlist: LiveData<itemExpedetionState>
|
||||
get() = _itemexpeditionlist
|
||||
|
||||
|
||||
private val _itemexpedition by lazy { MutableLiveData<itemExpedetionState>() }
|
||||
val itemexpedition: LiveData<itemExpedetionState>
|
||||
get() = _itemexpedition
|
||||
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
@ -50,66 +45,36 @@ class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
|||
get() = _itemsExpeditionlist
|
||||
|
||||
fun expedition_getStateJSON(expeditionFk: Int) {
|
||||
silex.expedition_getStateJSON(expeditionFk)
|
||||
.enqueue(object : Callback<JsonObject> {
|
||||
override fun onFailure(call: Call<JsonObject>, t: Throwable) {
|
||||
salix.expedition_getState(params = arrayListOf(expeditionFk))
|
||||
.enqueue(object : SalixCallback<ArrayList<JsonObject>>(context) {
|
||||
override fun onSuccess(response: Response<ArrayList<JsonObject>>) {
|
||||
_itemexpedition.value = itemExpedetionState(
|
||||
isError = false,
|
||||
errorMessage = "",
|
||||
list = if (response.body()!!.size > 0) {
|
||||
getListFromJSON(response.body()!![0].asJsonObject)
|
||||
} else {
|
||||
mutableListOf()
|
||||
}
|
||||
)
|
||||
|
||||
var listProperties: MutableList<itemsExpeditionDynamics> = mutableListOf()
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_itemexpedition.value = itemExpedetionState(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!),
|
||||
list = listProperties
|
||||
list = mutableListOf()
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<JsonObject>, response: Response<JsonObject>) {
|
||||
|
||||
|
||||
var listProperties: MutableList<itemsExpeditionDynamics> = mutableListOf()
|
||||
|
||||
if (response.body() != null) {
|
||||
|
||||
listProperties = getListFromJSON(response.body()!!.asJsonObject)
|
||||
|
||||
_itemexpedition.value = itemExpedetionState(
|
||||
isError = false,
|
||||
errorMessage = "", list = listProperties
|
||||
)
|
||||
|
||||
let {
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
_itemexpedition.value = itemExpedetionState(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
), list = listProperties
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/* private fun jsonToMap(json: JsonObject): Map<String, String> {
|
||||
val map: MutableMap<String, String> = linkedMapOf()
|
||||
for (key in js("Object").keys(json)) {
|
||||
map.put(key, json[key] as String)
|
||||
}
|
||||
return map
|
||||
}*/
|
||||
fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
|
||||
val gson = Gson()
|
||||
var list = mutableListOf<itemsExpeditionDynamics>()
|
||||
|
||||
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||
|
||||
var expeditionState: Map<String, String?> =
|
||||
gson.fromJson(json, object : TypeToken<Map<String, String?>>() {}.type)
|
||||
expeditionState.forEach {
|
||||
|
@ -120,7 +85,6 @@ class ExpeditionStateViewModel(val context: Context) : BaseViewModel(context) {
|
|||
return list
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
|
@ -24,16 +23,16 @@ import java.text.SimpleDateFormat
|
|||
import java.util.*
|
||||
import java.util.Calendar.getInstance as getInstance1
|
||||
|
||||
|
||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
||||
class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBinding, ExpeditionTruckListViewModel>(
|
||||
ExpeditionTruckListViewModel::class) {
|
||||
class ExpeditionTruckListFragment :
|
||||
BaseFragment<FragmentExpeditionTruckListBinding, ExpeditionTruckListViewModel>(
|
||||
ExpeditionTruckListViewModel::class
|
||||
) {
|
||||
|
||||
private var adapter : ExpeditionListAdapter? = null
|
||||
private var adapter: ExpeditionListAdapter? = null
|
||||
private lateinit var customDialogHor: CustomDialogHour
|
||||
private var onTruckClickListener: OnTruckClickListener? = null
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance() = ExpeditionTruckListFragment()
|
||||
}
|
||||
|
@ -50,7 +49,7 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
override fun init() {
|
||||
customDialogHor = CustomDialogHour(requireContext())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan)+getCURDATE()
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.psScan) + getCURDATE()
|
||||
binding.mainToolbar.backButton.setOnClickListener {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
|
@ -61,35 +60,40 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
super.init()
|
||||
}
|
||||
|
||||
private fun setToolBar(){
|
||||
val listIcons:ArrayList<Drawable> = ArrayList()
|
||||
val iconReload : Drawable = resources.getDrawable(R.drawable.ic_autorenew_black_24dp,resources.newTheme())
|
||||
val iconPlus : Drawable = resources.getDrawable(R.drawable.ic_add_black_24dp,resources.newTheme())
|
||||
val iconState : Drawable = resources.getDrawable(R.drawable.ic_visibility_white_24dp,resources.newTheme())
|
||||
private fun setToolBar() {
|
||||
val listIcons: ArrayList<Drawable> = ArrayList()
|
||||
val iconReload: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_autorenew_black_24dp, resources.newTheme())
|
||||
val iconPlus: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_add_black_24dp, resources.newTheme())
|
||||
val iconState: Drawable =
|
||||
resources.getDrawable(R.drawable.ic_visibility_white_24dp, resources.newTheme())
|
||||
|
||||
listIcons.add(iconState)
|
||||
listIcons.add(iconReload)
|
||||
listIcons.add(iconPlus)
|
||||
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapter(listIcons,object: OnOptionsSelectedListener {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload){
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionTruckList()
|
||||
}else if(item == iconPlus){
|
||||
addTruck()
|
||||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapter(listIcons, object : OnOptionsSelectedListener {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
if (item == iconReload) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.expeditionTruckList()
|
||||
} else if (item == iconPlus) {
|
||||
addTruck()
|
||||
}
|
||||
if (item == iconState) {
|
||||
ma.openFragmentExpeditionState()
|
||||
}
|
||||
}
|
||||
if (item == iconState){
|
||||
ma.openFragmentExpeditionState()
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun getCURDATE():String{
|
||||
private fun getCURDATE(): String {
|
||||
val c: Date = getInstance1().getTime()
|
||||
val df = SimpleDateFormat(getString(R.string.dayFormat))
|
||||
return df.format(c)
|
||||
|
@ -97,9 +101,9 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun observeViewModel() {
|
||||
with(viewModel){
|
||||
with(viewModel) {
|
||||
loadExpeditionTruckList.observe(viewLifecycleOwner, Observer { event ->
|
||||
event.getContentIfNotHandled().notNull {printExpeditionList(it) }
|
||||
event.getContentIfNotHandled().notNull { printExpeditionList(it) }
|
||||
})
|
||||
loadResponseExpeditionAdd.observe(viewLifecycleOwner, Observer { event ->
|
||||
viewModel.expeditionTruckList()
|
||||
|
@ -107,39 +111,42 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
}
|
||||
}
|
||||
|
||||
private fun printExpeditionList(it: ItemExpeditionTruckList){
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun printExpeditionList(it: ItemExpeditionTruckList) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
// Tarea#4125 Refactor Destino por description
|
||||
for (itemExp in it.list){
|
||||
if (itemExp.description.isNullOrEmpty()){
|
||||
itemExp.description=itemExp.Destino
|
||||
}
|
||||
}
|
||||
adapter = ExpeditionListAdapter(it.list,onTruckClickListener!!)
|
||||
// Tarea#4125 Refactor Destino por description
|
||||
|
||||
it.list.filter { it.eta != null }
|
||||
.map { it.eta = it.eta.replace("T", " ").substring(0, it.eta.length - 5) }
|
||||
adapter = ExpeditionListAdapter(it.list, onTruckClickListener!!)
|
||||
binding.expeditionTruckRecyclerview.adapter = adapter
|
||||
binding.expeditionTruckRecyclerview.layoutManager = lm
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun addTruck(){
|
||||
customDialogHor.setTitle(getString(R.string.newTruck)).setOkButton(getString(R.string.save)){
|
||||
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
||||
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue().isNotEmpty()){
|
||||
customDialogActionTruck()
|
||||
private fun addTruck() {
|
||||
customDialogHor.setTitle(getString(R.string.newTruck))
|
||||
.setOkButton(getString(R.string.save)) {
|
||||
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
||||
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue()
|
||||
.isNotEmpty()
|
||||
) {
|
||||
customDialogActionTruck()
|
||||
|
||||
}
|
||||
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
||||
customDialogHor.dismiss()
|
||||
}.setKoButton(getString(R.string.cancel)){
|
||||
customDialogHor.dismiss()
|
||||
}.setHoraValue("").setDestinoValue("").show()
|
||||
}
|
||||
ma.hideKeyboard(customDialogHor.getDestinoEditText())
|
||||
customDialogHor.dismiss()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
customDialogHor.dismiss()
|
||||
}.setHoraValue("").setDestinoValue("").show()
|
||||
|
||||
customDialogHor.getDestinoEditText().requestFocus()
|
||||
customDialogHor.getDestinoEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (customDialogHor.getDestinoValue().isNotEmpty() && customDialogHor.getHoraValue()
|
||||
.isNotEmpty()){
|
||||
.isNotEmpty()
|
||||
) {
|
||||
customDialogActionTruck()
|
||||
}
|
||||
|
||||
|
@ -152,12 +159,14 @@ class ExpeditionTruckListFragment : BaseFragment<FragmentExpeditionTruckListBin
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun customDialogActionTruck() {
|
||||
viewModel.expeditionTruckAdd(customDialogHor.getHoraValue(),customDialogHor.getDestinoValue())
|
||||
viewModel.expeditionTruckAdd(
|
||||
customDialogHor.getHoraValue(),
|
||||
customDialogHor.getDestinoValue()
|
||||
)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
customDialogHor.dismiss()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package es.verdnatura.presentation.view.feature.paletizador.fragment
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -29,16 +27,21 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
|
|||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val loadResponseExpeditionAdd = Transformations.map(_response) { Event(it) }
|
||||
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun expeditionTruckList() {
|
||||
// Tarea 5134 modificar fecha para que se vea correctamente y no con 0.00Z
|
||||
/* salix.expeditionTruckGet(
|
||||
salix.expeditionTruckGet(
|
||||
"""{"where": { "eta": {
|
||||
"between": ["${LocalDate.now().atTime(LocalTime.MIN)}", "${LocalDate.now().atTime(LocalTime.MAX)}"]}}}"""
|
||||
).enqueue(object : SalixCallback<List<ItemExpeditionTruckVO>>(context) {*/
|
||||
silex.expeditionTruckList().enqueue(object :
|
||||
SilexCallback<List<ItemExpeditionTruckVO>>(context) {
|
||||
"between": ["${LocalDate.now().atTime(LocalTime.MIN)}",
|
||||
"${
|
||||
LocalDate.now().atTime(LocalTime.MAX)
|
||||
}"]}}}"""
|
||||
).enqueue(object : SalixCallback<List<ItemExpeditionTruckVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemExpeditionTruckVO>>) {
|
||||
_expeditionTruckList.value =
|
||||
response.body()?.let { ItemExpeditionTruckList(it) }
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemExpeditionTruckVO> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -51,26 +54,6 @@ class ExpeditionTruckListViewModel(val context: Context) : BaseViewModel(context
|
|||
_expeditionTruckList.value = ItemExpeditionTruckList(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemExpeditionTruckVO>>) {
|
||||
if (response.body() != null) {
|
||||
_expeditionTruckList.value =
|
||||
response.body()?.let { ItemExpeditionTruckList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemExpeditionTruckVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemExpeditionTruckVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_expeditionTruckList.value = ItemExpeditionTruckList(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -133,10 +133,9 @@ class PalletScanFragment(
|
|||
customDialogList.getValue(),
|
||||
"expeditionPallet",
|
||||
"id"
|
||||
) as Int
|
||||
).toString().toInt()
|
||||
|
||||
} catch (ex: Exception) {
|
||||
|
||||
ex.message!!.toast(requireContext())
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -28,9 +29,9 @@ class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
vPalletId: Int,
|
||||
vStatePallet: String
|
||||
) {
|
||||
silex.expeditionState_addByPallet(
|
||||
salix.expeditionStateAddByPallet(arrayListOf(
|
||||
vPalletId,
|
||||
vStatePallet
|
||||
vStatePallet).formatWithQuotes()
|
||||
)
|
||||
.enqueue(object : SilexCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
|
|
@ -4,10 +4,10 @@ import com.google.gson.annotations.SerializedName
|
|||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||
|
||||
class ItemExpeditionTruckVO(
|
||||
var truckFk: Int,
|
||||
var id: Int,
|
||||
//Tarea 4902
|
||||
@SerializedName(value = "ETD", alternate = ["eta"])
|
||||
var ETD: String = "",
|
||||
var eta: String = "",
|
||||
var Destino: String = "",
|
||||
var description: String = "",
|
||||
var isError: Boolean = false,
|
||||
|
|
|
@ -125,7 +125,7 @@ class ParkingFragment (var menuOrigin:String): BaseFragment<FragmentParkingBindi
|
|||
numParking = scanerList.size
|
||||
scanerList.forEach {
|
||||
// binding.splashProgress.visibility = View.VSIIBLE
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
parking = txtScan,
|
||||
scanItem = it.code!!
|
||||
)
|
||||
|
|
|
@ -5,7 +5,8 @@ import android.view.View.GONE
|
|||
import android.view.View.VISIBLE
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -35,24 +36,24 @@ class ParkingViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_isLoadingProgress.value = visibility
|
||||
}
|
||||
|
||||
fun parking(scanItem: String, parking: String) {
|
||||
fun setParking(scanItem: String, parking: String) {
|
||||
ProgressLoading(VISIBLE)
|
||||
silex.shelvingPark(scanItem, parking).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
ProgressLoading(GONE)
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
|
||||
.enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
ProgressLoading(GONE)
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
ProgressLoading(GONE)
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
override fun onError(t: Throwable) {
|
||||
ProgressLoading(GONE)
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ class ParkingSaleFragment : BaseFragment<FragmentParkingBinding,ParkingSaleViewM
|
|||
numParking = scanerList.size
|
||||
scanerList.forEach {
|
||||
// binding.splashProgress.visibility = View.VSIIBLE
|
||||
viewModel.parking(
|
||||
viewModel.setParking(
|
||||
parking = txtScan,
|
||||
scanItem = it.code!!
|
||||
)
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package es.verdnatura.presentation.view.feature.parking.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View.GONE
|
||||
import android.view.View
|
||||
import android.view.View.VISIBLE
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -23,12 +24,10 @@ class ParkingSaleViewModel(val context: Context) : BaseViewModel(context) {
|
|||
private val _isLoadingProgress by lazy { MutableLiveData<Int>() }
|
||||
val isLoadingProgress: LiveData<Int> = _isLoadingProgress
|
||||
|
||||
|
||||
private val _responseParkingAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseParkingAdd: LiveData<ResponseItemVO>
|
||||
get() = _responseParkingAdd
|
||||
|
||||
|
||||
private fun showProgressLoading() {
|
||||
_isLoading.value = true
|
||||
}
|
||||
|
@ -41,24 +40,23 @@ class ParkingSaleViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_isLoadingProgress.value = visibility
|
||||
}
|
||||
|
||||
fun parking(scanItem: String, parking: String) {
|
||||
fun setParking(scanItem: String, parking: String) {
|
||||
ProgressLoading(VISIBLE)
|
||||
silex.shelvingPark(scanItem, parking).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
salix.setParking(arrayListOf(scanItem, parking).formatWithQuotes())
|
||||
.enqueue(object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
ProgressLoading(View.GONE)
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
ProgressLoading(GONE)
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -87,7 +87,6 @@ class EndSacadorFragment(
|
|||
private var originalItemScan: String = ""
|
||||
private var isScanned: Boolean? = null
|
||||
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
|
||||
super.onAttach(context)
|
||||
|
@ -101,7 +100,6 @@ class EndSacadorFragment(
|
|||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
customDialog = CustomDialog(requireContext())
|
||||
customDialogList = CustomDialogList(requireContext())
|
||||
|
@ -121,7 +119,7 @@ class EndSacadorFragment(
|
|||
requireActivity().onBackPressed()
|
||||
|
||||
}
|
||||
//ESCANER =========
|
||||
//ESCANER =========f
|
||||
hideKeyboards()
|
||||
binding.scanInput.requestFocus()
|
||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
||||
|
@ -153,7 +151,6 @@ class EndSacadorFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
binding.scanInput.setText("")
|
||||
hideKeyboards()
|
||||
|
@ -179,7 +176,6 @@ class EndSacadorFragment(
|
|||
with(viewModel) {
|
||||
salesList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
//d("VERDNATURA::","la lista es {$it}")
|
||||
createSaleList(it)
|
||||
})
|
||||
|
||||
|
@ -262,7 +258,6 @@ class EndSacadorFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
responseSplit.observe(viewLifecycleOwner, Observer {
|
||||
|
@ -271,7 +266,6 @@ class EndSacadorFragment(
|
|||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true, true)
|
||||
|
||||
|
||||
} else {
|
||||
// responseSaleMoveSuccesful()
|
||||
ma.messageWithSound(getString(R.string.splitOk), isError = false, true)
|
||||
|
@ -419,14 +413,12 @@ class EndSacadorFragment(
|
|||
markLine(positionCollectionSplit)
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
|
||||
//enviar mensaje a salix
|
||||
/* val ticket =
|
||||
"[" + sales[positionCollectionSplit].id + "](https://salix.verdnatura.es/#!/ticket/" + sales[positionCollectionSplit].id + "/summary)"
|
||||
val message =
|
||||
getString(R.string.splitSent) + sales[positionCollectionSplit].itemFk + getString(R.string.fromTicket) + ticket*/
|
||||
|
||||
|
||||
/* viewModel.sendChekingPresence(
|
||||
token = getData(TOKEN),
|
||||
workerId = sales[positionCollectionSplit].salesPersonFk,
|
||||
|
@ -437,10 +429,8 @@ class EndSacadorFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
private fun incresaseSuccesful() {
|
||||
|
||||
|
||||
try {
|
||||
sales[positionIncreaseQuantity].saldo = quantityIncrease.toInt()
|
||||
} catch (e: Exception) {
|
||||
|
@ -481,7 +471,7 @@ class EndSacadorFragment(
|
|||
|
||||
if (ticketFk != 0)
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.sectorCollectionSaleGroup_add(
|
||||
viewModel.sectorCollectionSaleGroupAdd(
|
||||
ticketFk,
|
||||
collection.collectionFk
|
||||
)
|
||||
|
@ -589,25 +579,17 @@ class EndSacadorFragment(
|
|||
if (totalMark == sales.size) {
|
||||
getString(R.string.ticketCompleted).toast(this.context, Toast.LENGTH_SHORT)
|
||||
|
||||
saleTracking_addPrevOK()
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.saleTrackingAddPrevOK(
|
||||
sectorCollectionFk = collection.collectionFk
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun saleTracking_addPrevOK() {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.saleTracking_addPrevOK(
|
||||
vSectorCollectionFk = collection.collectionFk
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setListPosition(position: Int) {
|
||||
storedPosition = position
|
||||
|
||||
binding.fragmentSacadorCollections.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position, 0)
|
||||
|
||||
|
@ -692,26 +674,18 @@ class EndSacadorFragment(
|
|||
setTotalLines()
|
||||
}
|
||||
|
||||
|
||||
private fun saleTrackingReplace(position: Int) {
|
||||
|
||||
|
||||
if (sales[position].picked == sales[position].quantity || sales[position].picked == 0) {
|
||||
|
||||
viewModel.saleTracking_updateIsChecked(
|
||||
vSaleFk = sales[position].idMovimiento.toInt(),
|
||||
viewModel.saleTrackingUpdateIsChecked(
|
||||
vSaleFk = sales[position].idMovimiento,
|
||||
vIsChecked = sales[position].picked == sales[position].quantity,
|
||||
vIsScanned = isScanned
|
||||
|
||||
)
|
||||
}
|
||||
/* if (sales[position].picked == 0) {
|
||||
viewModel.saleTracking_updateIsChecked(
|
||||
vSaleFk = sales[position].idMovimiento.toInt(),
|
||||
vIsChecked = sales[position].picked == sales[position].quantity
|
||||
|
||||
)
|
||||
}*/
|
||||
isScanned = null
|
||||
}
|
||||
|
||||
|
@ -746,7 +720,6 @@ class EndSacadorFragment(
|
|||
}.show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//SHELVINGS
|
||||
|
@ -824,7 +797,6 @@ class EndSacadorFragment(
|
|||
getString(R.string.scanItemValidate).toast(requireContext())
|
||||
}
|
||||
|
||||
|
||||
}.setKoButton(getString(R.string.close)) {
|
||||
scanRequest()
|
||||
hideKeyboards()
|
||||
|
@ -917,7 +889,6 @@ class EndSacadorFragment(
|
|||
sales[storedPosition].carros[storedShelvingPosition].stockTotal =
|
||||
(shelvingVisible.toInt() - customDialogList.getValue().toInt()).toString()
|
||||
|
||||
|
||||
//sergio: se añade línea que actualiza la pantalla. Es posible que falle
|
||||
// el itemShelvingSaleSupplyAdd que se actualiza pantalla si falla se actualizará todo
|
||||
|
||||
|
@ -926,7 +897,7 @@ class EndSacadorFragment(
|
|||
.toInt()).toString() + ")"
|
||||
|
||||
|
||||
viewModel.itemShelvingSaleSupplyAdd(
|
||||
viewModel.itemShelvingSaleAdd(
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
saleFk = sales[storedPosition].idMovimiento,
|
||||
quantity = customDialogList.getValue().toInt()
|
||||
|
@ -945,7 +916,6 @@ class EndSacadorFragment(
|
|||
//3- MARCAR LINEA
|
||||
markLine(storedPosition)
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun checkItemScan(valueToCheck: String): Boolean {
|
||||
|
@ -1010,7 +980,6 @@ class EndSacadorFragment(
|
|||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
|
||||
goBack = false
|
||||
/*if (item == iconEraser) {
|
||||
|
||||
|
@ -1022,7 +991,6 @@ class EndSacadorFragment(
|
|||
), ""
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1040,7 +1008,6 @@ class EndSacadorFragment(
|
|||
requireActivity().hideKeyboard()
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(collection: CollectionVO?, entrypoint: String) = EndSacadorFragment(
|
||||
collection!!, entrypoint
|
||||
|
@ -1067,7 +1034,6 @@ class EndSacadorFragment(
|
|||
}.show()
|
||||
}
|
||||
|
||||
|
||||
private fun showQuantityDialog(position: Int) {
|
||||
try {
|
||||
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad))
|
||||
|
@ -1123,7 +1089,6 @@ class EndSacadorFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun increaseQuantity(position: Int, quantity: Int) {
|
||||
positionIncreaseQuantity = position
|
||||
quantityIncrease = quantity
|
||||
|
@ -1133,7 +1098,6 @@ class EndSacadorFragment(
|
|||
quantity = quantity
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import es.verdnatura.presentation.view.component.CustomDialogInput
|
|||
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapter
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
|
||||
|
||||
class InitPreSacadorFragment(
|
||||
var entrypoint: String = ""
|
||||
) :
|
||||
|
@ -36,7 +35,6 @@ class InitPreSacadorFragment(
|
|||
private var adapter: CollectionAdapter? = null
|
||||
private lateinit var customDialogInput: CustomDialogInput
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint: String) = InitPreSacadorFragment(entryPoint)
|
||||
}
|
||||
|
@ -56,7 +54,7 @@ class InitPreSacadorFragment(
|
|||
binding.splashProgressTwo.visibility = View.GONE
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.sectorCollection_get()
|
||||
viewModel.sectorCollectionGet()
|
||||
super.init()
|
||||
|
||||
}
|
||||
|
@ -104,6 +102,7 @@ class InitPreSacadorFragment(
|
|||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.sectorCollection_new(getDataInt(SECTORFK))
|
||||
}
|
||||
|
||||
iconPrint.drawable -> {
|
||||
showPrintPrevious()
|
||||
}
|
||||
|
@ -117,7 +116,7 @@ class InitPreSacadorFragment(
|
|||
private fun print() {
|
||||
if (ma.havePrinter()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
||||
viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt())
|
||||
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
||||
requireContext()
|
||||
)
|
||||
|
@ -164,18 +163,15 @@ class InitPreSacadorFragment(
|
|||
}
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
binding.sacadorSwipe.setOnRefreshListener {
|
||||
viewModel.sectorCollection_get()
|
||||
viewModel.sectorCollectionGet()
|
||||
binding.sacadorSwipe.isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
|
@ -212,7 +208,7 @@ class InitPreSacadorFragment(
|
|||
|
||||
} else {
|
||||
//if (goBack)
|
||||
viewModel.sectorCollection_get()
|
||||
viewModel.sectorCollectionGet()
|
||||
}
|
||||
goBack = false
|
||||
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
||||
|
@ -259,5 +255,4 @@ class InitPreSacadorFragment(
|
|||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,9 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -46,10 +48,9 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseSaleTrackingUpdate: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleTrackingUpdate
|
||||
|
||||
/* private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleMove: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleMove*/
|
||||
|
||||
/* private val _responseSaleMove by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleMove: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleMove*/
|
||||
|
||||
private val _responseParkingAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseParkingAdd: LiveData<ResponseItemVO>
|
||||
|
@ -108,20 +109,19 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
ticketFk: String,
|
||||
parking: String
|
||||
) {
|
||||
silex.shelvingPark(ticketFk, parking)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.setParking(arrayListOf(ticketFk, parking).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!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -130,24 +130,14 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
quantity: Int,
|
||||
itemFk: Int
|
||||
) {
|
||||
silex.itemPlacementSupplyAiming(
|
||||
shelvingFk,
|
||||
quantity,
|
||||
itemFk
|
||||
salix.itemPlacementSupplyAiming(
|
||||
arrayListOf(
|
||||
shelvingFk,
|
||||
quantity,
|
||||
itemFk
|
||||
).formatWithQuotes()
|
||||
).enqueue(object :
|
||||
SilexCallback<List<PlacementSupplyVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
PlacementSupplyVO(
|
||||
itemShelvingFk = 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
|
||||
SalixCallback<List<PlacementSupplyVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<PlacementSupplyVO>>) {
|
||||
if (response.body() != null) {
|
||||
_placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) }
|
||||
|
@ -166,34 +156,47 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<PlacementSupplyVO> = ArrayList()
|
||||
listError.add(
|
||||
PlacementSupplyVO(
|
||||
itemShelvingFk = 0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_placementSuppleyList.value = PlacementSupplyListVO(listError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelvingSaleSupplyAdd(
|
||||
fun itemShelvingSaleAdd(
|
||||
itemShelvingFk: Int,
|
||||
saleFk: Int,
|
||||
quantity: Int
|
||||
) {
|
||||
silex.itemShelvingSaleSupplyAdd(
|
||||
itemShelvingFk,
|
||||
saleFk,
|
||||
quantity
|
||||
salix.itemShelvingSaleAdd(
|
||||
arrayListOf(
|
||||
itemShelvingFk,
|
||||
saleFk,
|
||||
quantity
|
||||
).formatWithQuotes()
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
_responseItemShelvingSaleSupplyAdd.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseItemShelvingSaleSupplyAdd.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
_responseItemShelvingSaleSupplyAdd.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun saleTrackingReplace(
|
||||
saleFk: String,
|
||||
vOriginalQuantity: String,
|
||||
|
@ -292,50 +295,28 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun ticketPrintLabelPrevious(ticketFk: Int) {
|
||||
salix.ticketPrintLabelPrevious(arrayListOf(ticketFk))
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
|
||||
fun ticket_printLabelPrevious(ticketFk: Int) {
|
||||
|
||||
silex.ticket_printLabelPrevious(ticketFk).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
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 sectorCollection_get() {
|
||||
|
||||
silex.sectorCollection_get().enqueue(object :
|
||||
SilexCallback<List<CollectionVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
CollectionVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
}
|
||||
|
||||
|
||||
fun sectorCollectionGet() {
|
||||
salix.sectorCollectionGet(params = null).enqueue(object :
|
||||
SalixCallback<List<CollectionVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<CollectionVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_collectionList.value =
|
||||
response.body()?.let { CollectionListVO(it.toDateFormat(context)) }
|
||||
|
@ -352,19 +333,42 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
CollectionVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun sectorCollection_new(
|
||||
sectorFk: Int
|
||||
) {
|
||||
silex.sectorCollection_new(sectorFk).enqueue(
|
||||
salix.sectorCollectionNew(sectorFk).enqueue(
|
||||
object :
|
||||
SilexCallback<Any>(context) {
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value =
|
||||
ResponseItemVO(
|
||||
|
@ -374,18 +378,6 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
t.message!!
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -415,17 +407,27 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun sectorCollectionSaleGroup_add(
|
||||
|
||||
fun sectorCollectionSaleGroupAdd(
|
||||
vSaleGroupFk: Int,
|
||||
vSectorCollectionFk: Int
|
||||
) {
|
||||
silex.sectorCollectionSaleGroup_add(
|
||||
vSaleGroupFk,
|
||||
vSectorCollectionFk
|
||||
salix.sectorCollectionSaleGroupAdd(
|
||||
arrayListOf(
|
||||
vSaleGroupFk,
|
||||
vSectorCollectionFk
|
||||
).formatWithQuotes()
|
||||
).enqueue(
|
||||
object :
|
||||
SilexCallback<Any>(context) {
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseSaleGroupAdd.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value =
|
||||
ResponseItemVO(
|
||||
|
@ -436,61 +438,19 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseSaleGroupAdd.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun saleTracking_addPrevOK(
|
||||
vSectorCollectionFk: Int
|
||||
fun saleTrackingAddPrevOK(
|
||||
sectorCollectionFk: Int
|
||||
) {
|
||||
silex.saleTracking_addPrevOK(vSectorCollectionFk).enqueue(
|
||||
object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleAddPrevOK.value =
|
||||
ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseSaleAddPrevOK.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
+ getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun saleTracking_updateIsChecked(
|
||||
vSaleFk: Int,
|
||||
vIsChecked: Boolean,
|
||||
vIsScanned: Boolean?
|
||||
) {
|
||||
silex.saleTracking_updateIsChecked(vSaleFk, vIsChecked, vIsScanned)
|
||||
salix.saleTrackingAddPrevOK(arrayListOf(sectorCollectionFk))
|
||||
.enqueue(
|
||||
object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleupdateIsChecked.value =
|
||||
_responseSaleAddPrevOK.value =
|
||||
ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
|
@ -499,11 +459,10 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseSaleupdateIsChecked.value = ResponseItemVO(
|
||||
_responseSaleAddPrevOK.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
+ getMessageFromAllResponse(
|
||||
|
@ -514,6 +473,44 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun saleTrackingUpdateIsChecked(
|
||||
vSaleFk: Int,
|
||||
vIsChecked: Boolean,
|
||||
vIsScanned: Boolean?
|
||||
) {
|
||||
salix.saleTrackingUpdateIsChecked(
|
||||
arrayListOf(
|
||||
vSaleFk,
|
||||
vIsChecked,
|
||||
vIsScanned
|
||||
).formatWithQuotes()
|
||||
)
|
||||
.enqueue(
|
||||
object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseSaleupdateIsChecked.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
+ getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleupdateIsChecked.value =
|
||||
ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelving_updateFromSale(
|
||||
saleFk: Int
|
||||
|
|
|
@ -61,9 +61,9 @@ class QrFragment(
|
|||
goBack = false
|
||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.qr_getCall(
|
||||
/*viewModel.qr_getCall(
|
||||
binding.scanInput.text.toString()
|
||||
)
|
||||
)*/
|
||||
itemscaned = binding.scanInput.text.toString()
|
||||
}
|
||||
|
||||
|
|
|
@ -4,13 +4,8 @@ package es.verdnatura.presentation.view.feature.qr
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
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 QrFragmentViewModel(var context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
@ -18,52 +13,6 @@ class QrFragmentViewModel(var context: Context) : BaseViewModel(context) {
|
|||
val qrresponse: LiveData<ResponseItemVO>
|
||||
get() = _qrresponse
|
||||
|
||||
|
||||
fun qr_getCall(vStatement: String) {
|
||||
silex.qr_getCall(vStatement)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_qrresponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
if (response.raw().code() == 555 || response.raw().code() == 403) {
|
||||
|
||||
_qrresponse.value = ResponseItemVO(
|
||||
response = "",
|
||||
isError = true,
|
||||
errorMessage = context.getString(
|
||||
R.string.userNotPermission
|
||||
)
|
||||
)
|
||||
|
||||
} else if (response.body() != null) {
|
||||
_qrresponse.value = ResponseItemVO(
|
||||
response = response.body().toString(),
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
)
|
||||
|
||||
} else {
|
||||
|
||||
_qrresponse.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class SacadorFragment(
|
|||
}
|
||||
|
||||
"PREITEMPICKER" -> {
|
||||
viewModel.sectorCollection_get()
|
||||
viewModel.sectorCollectionGet()
|
||||
}
|
||||
|
||||
else -> {
|
||||
|
@ -123,14 +123,12 @@ class SacadorFragment(
|
|||
viewModel.collection_assign(
|
||||
)
|
||||
} else {
|
||||
viewModel.sectorCollection_new(getDataInt(SECTORFK))
|
||||
viewModel.sectorCollectionNew(getDataInt(SECTORFK))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
|
||||
|
||||
iconPrint.drawable -> {
|
||||
showPrintPrevious()
|
||||
}
|
||||
|
@ -175,7 +173,7 @@ class SacadorFragment(
|
|||
if (customDialogInput.getValue().isNotEmpty()
|
||||
) {
|
||||
if (ma.havePrinter()) {
|
||||
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
||||
viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt())
|
||||
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
||||
requireContext()
|
||||
)
|
||||
|
|
|
@ -12,13 +12,14 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentSacadorBinding
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.base.BaseFragmentSalix
|
||||
import es.verdnatura.presentation.common.OnCollectionTicketSelectedListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.TAG
|
||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
||||
import es.verdnatura.presentation.view.feature.modelViewModel.FragmentsViewModel
|
||||
import es.verdnatura.presentation.view.feature.sacador.adapter.CollectionAdapterNew
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
|
||||
|
@ -26,7 +27,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
|||
class SacadorFragmentNew(
|
||||
var type: String
|
||||
) :
|
||||
BaseFragment<FragmentSacadorBinding, SacadorViewModel>(SacadorViewModel::class) {
|
||||
BaseFragmentSalix<FragmentSacadorBinding, SacadorViewModel, FragmentsViewModel>(SacadorViewModel::class,FragmentsViewModel::class) {
|
||||
|
||||
private var onCollectionSelectedListener: OnCollectionTicketSelectedListener? = null
|
||||
private var goBack: Boolean = false
|
||||
|
@ -55,6 +56,7 @@ class SacadorFragmentNew(
|
|||
setToolBar()
|
||||
setEvents()
|
||||
callBack(type)
|
||||
println("SacadorNEW")
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -66,7 +68,7 @@ class SacadorFragmentNew(
|
|||
}
|
||||
|
||||
"PREITEMPICKER" -> {
|
||||
viewModel.sectorCollection_get()
|
||||
viewModel.sectorCollectionGet()
|
||||
}
|
||||
|
||||
else -> {
|
||||
|
@ -123,14 +125,12 @@ class SacadorFragmentNew(
|
|||
viewModel.collection_assignNew(
|
||||
)
|
||||
} else {
|
||||
viewModel.sectorCollection_new(getDataInt(SECTORFK))
|
||||
viewModel.sectorCollectionNew(getDataInt(SECTORFK))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
iconVehicleIn.drawable -> ma.onVehicleSelected(SacadorFragment.TAG)
|
||||
|
||||
iconPrint.drawable -> {
|
||||
showPrintPrevious()
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class SacadorFragmentNew(
|
|||
if (customDialogInput.getValue().isNotEmpty()
|
||||
) {
|
||||
if (ma.havePrinter()) {
|
||||
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
||||
viewModel.ticketPrintLabelPrevious(customDialogInput.getValue().toInt())
|
||||
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
||||
requireContext()
|
||||
)
|
||||
|
@ -202,19 +202,28 @@ class SacadorFragmentNew(
|
|||
}
|
||||
|
||||
override fun observeViewModel() {
|
||||
with(viewModelSalix) {
|
||||
responseCallBack.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
} else {
|
||||
if (goBack) {
|
||||
if (it.response != null){
|
||||
createCollectionList( it.response as List<CollectionTicket>)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
goBack = false
|
||||
})
|
||||
}
|
||||
with(viewModel) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
collectionListLocal.observe(viewLifecycleOwner, Observer {
|
||||
if (!goBack2) binding.splashProgress.visibility = View.GONE
|
||||
println("sacador creada colecc")
|
||||
for (l in it.list) {
|
||||
println("sacador col ${l.collectionFk}")
|
||||
println("sacador tic ${l.tickets}")
|
||||
for (t in l.tickets) {
|
||||
println("sacador id ticket${t.ticketFk}")
|
||||
}
|
||||
}
|
||||
|
||||
createCollectionList(it.list)
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
goBack2 = false
|
||||
|
@ -231,7 +240,7 @@ class SacadorFragmentNew(
|
|||
}
|
||||
}
|
||||
goBack = false
|
||||
callBack(type)
|
||||
//callBack(type)
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -265,7 +274,6 @@ class SacadorFragmentNew(
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
adapter?.notifyDataSetChanged()
|
||||
} else {
|
||||
customDialog.setTitle(getString(R.string.info))
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package es.verdnatura.presentation.view.feature.sacador.fragment
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
|
@ -17,7 +16,6 @@ import es.verdnatura.presentation.view.feature.sacador.model.CollectionListVO
|
|||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicketList
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.collectionLocal
|
||||
import retrofit2.Call
|
||||
import retrofit2.Response
|
||||
|
||||
|
@ -88,52 +86,51 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun sectorCollection_new(
|
||||
fun sectorCollectionNew(
|
||||
sectorFk: Int
|
||||
) {
|
||||
silex.sectorCollection_new(sectorFk).enqueue(
|
||||
object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value =
|
||||
ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
salix.sectorCollectionNew(arrayListOf(sectorFk))
|
||||
.enqueue(
|
||||
object :
|
||||
SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this), response.message()
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
})
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value =
|
||||
ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun ticket_printLabelPrevious(ticketFk: Int) {
|
||||
fun ticketPrintLabelPrevious(ticketFk: Int) {
|
||||
|
||||
silex.ticket_printLabelPrevious(ticketFk).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
salix.ticketPrintLabelPrevious(arrayListOf(ticketFk))
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
})
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
@ -174,7 +171,7 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun collection_assignNew() {
|
||||
silex.collection_assign().enqueue(
|
||||
object :
|
||||
SilexCallback<Int>(context) {
|
||||
SalixCallback<Int>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value =
|
||||
ResponseItemVO(
|
||||
|
@ -188,10 +185,9 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
override fun onSuccess(response: Response<Int>) {
|
||||
if (response.body() != null) {
|
||||
|
||||
itemShelvingSale_addByCollection(response.body()!!)
|
||||
/* _response.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!.toString())*/
|
||||
// itemShelvingSale_addByCollection(response.body()!!)
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!.toString())
|
||||
} else {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
|
@ -207,7 +203,7 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun itemShelvingSale_addByCollection(collection:Int) {
|
||||
fun itemShelvingSale_addByCollection(collection: Int) {
|
||||
salix.itemShelvingSale_addByCollection(collection).enqueue(
|
||||
object :
|
||||
SalixCallback<Any>(context) {
|
||||
|
@ -243,8 +239,8 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun collectionGet() {
|
||||
silex.collectionGet().enqueue(object :
|
||||
SilexCallback<List<CollectionVO>>(context) {
|
||||
salix.getCollectionSalix().enqueue(object :
|
||||
SalixCallback<List<CollectionVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
|
@ -281,26 +277,9 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun sectorCollection_get() {
|
||||
|
||||
silex.sectorCollection_get().enqueue(object :
|
||||
fun sectorCollectionGet() {
|
||||
salix.sectorCollectionGet().enqueue(object :
|
||||
SilexCallback<List<CollectionVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
CollectionVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
}
|
||||
|
||||
|
||||
override fun onSuccess(response: Response<List<CollectionVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
|
@ -322,11 +301,23 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
CollectionVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
fun collectionGetSalix() {
|
||||
salix.getCollectionSalix().enqueue(object :
|
||||
SilexCallback<List<CollectionVO>>(context) {
|
||||
|
@ -386,7 +377,7 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
if (response.body() != null) {
|
||||
_collectionListLocal.value =
|
||||
// CollectionTicketList(mutableListOf(collectionLocal))
|
||||
// CollectionTicketList(mutableListOf(collectionLocal))
|
||||
response.body()?.let { CollectionTicketList(it.toDateFormating(context)) }
|
||||
} else {
|
||||
val listError: ArrayList<CollectionTicket> = ArrayList()
|
||||
|
|
|
@ -110,18 +110,13 @@ class AutomaticAddItemFragment(
|
|||
|
||||
if (binding.mainToolbar.toolbarTitle.text.equals(getString(R.string.titleChecker))) {
|
||||
|
||||
viewModel.itemShelving_addList(
|
||||
viewModel.itemShelvingAddList(
|
||||
shelvingFk,
|
||||
"" + listInt + "",
|
||||
TRUE,
|
||||
getDataInt(WAREHOUSEFK)
|
||||
)
|
||||
} else {
|
||||
/* viewModel.itemShelving_addList(
|
||||
shelvingFk,
|
||||
"" + listInt + "",
|
||||
FALSE,
|
||||
getDataInt(WAREHOUSEFK))*/
|
||||
viewModel.itemShelvingMake_multi(
|
||||
shelvingFk,
|
||||
listString,
|
||||
|
|
|
@ -112,7 +112,7 @@ class AutomaticAddItemFragmentTEST(
|
|||
|
||||
if (binding.mainToolbar.toolbarTitle.text.equals(getString(R.string.titleChecker))) {
|
||||
|
||||
viewModel.itemShelving_addList(
|
||||
viewModel.itemShelvingAddList(
|
||||
shelvingFk,
|
||||
"" + listInt + "",
|
||||
TRUE,
|
||||
|
|
|
@ -3,7 +3,9 @@ package es.verdnatura.presentation.view.feature.ubicador.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -16,7 +18,6 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
|
||||
fun itemShelvingMake_multi(
|
||||
shelving: String,
|
||||
items: List<Long>,
|
||||
|
@ -42,19 +43,22 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun itemShelving_addList(
|
||||
fun itemShelvingAddList(
|
||||
shelving: String,
|
||||
items: Any,
|
||||
isChecking: Boolean,
|
||||
warehouse: Int
|
||||
) {
|
||||
silex.itemShelving_addList(
|
||||
shelving,
|
||||
items,
|
||||
isChecking,
|
||||
warehouse
|
||||
salix.itemShelvingAddList(
|
||||
arrayListOf(shelving, items, isChecking, warehouse).formatWithQuotes()
|
||||
).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
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(
|
||||
|
@ -63,13 +67,7 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -369,7 +369,7 @@ class UbicadorFragment(
|
|||
|
||||
customDialogInput.getEditText()
|
||||
.setOnEditorActionListener { v, actionId, event ->
|
||||
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 ) {
|
||||
customDialogActionChange()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ class UbicadorFragment(
|
|||
}
|
||||
|
||||
private fun customDialogActionParking() {
|
||||
viewModel.shelvingPark(
|
||||
viewModel.setParking(
|
||||
shelvingFk,
|
||||
customDialogInput.getValue()
|
||||
)
|
||||
|
@ -432,7 +432,7 @@ class UbicadorFragment(
|
|||
shelvingFk.uppercase() + getString(R.string.pUppercase) + parking + getString(
|
||||
R.string.label
|
||||
) + etiquetas
|
||||
customDialog.dismiss()
|
||||
customDialogInput.dismiss()
|
||||
}
|
||||
|
||||
private fun checkUbications(itemScanned: Int) {
|
||||
|
@ -451,7 +451,7 @@ class UbicadorFragment(
|
|||
}
|
||||
|
||||
}
|
||||
viewModel.itemShelving_addList(
|
||||
viewModel.itemShelvingAddList(
|
||||
shelvingFk,
|
||||
"" + listInt + "",
|
||||
TRUE,
|
||||
|
@ -617,24 +617,11 @@ class UbicadorFragment(
|
|||
}
|
||||
}
|
||||
}
|
||||
/* responseAddList.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
} else {
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.itemShelvingList(shelvingFk)
|
||||
|
||||
}
|
||||
})*/
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||
|
||||
|
||||
} else {
|
||||
viewModel.itemShelvingList(shelvingFk)
|
||||
ma.messageWithSound("", it.isError, true, isToasted = false)
|
||||
|
@ -716,7 +703,7 @@ class UbicadorFragment(
|
|||
} else {
|
||||
0
|
||||
}
|
||||
viewModel.itemShelving_selfConsumption(
|
||||
viewModel.itemShelvingSelfConsumption(
|
||||
shelvingFk,
|
||||
item.item,
|
||||
quantity
|
||||
|
@ -898,7 +885,7 @@ class UbicadorFragment(
|
|||
if (itemFk != null && visible != null) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.itemShelvingMake(
|
||||
viewModel.itemShelvingAdd(
|
||||
shelvingFk,
|
||||
itemFk,
|
||||
visible,
|
||||
|
@ -917,7 +904,7 @@ class UbicadorFragment(
|
|||
} else if (itemFk != null && etiquetas != null) {
|
||||
val visible_calc = (etiquetas * packing!!.toInt())
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.itemShelvingMake(
|
||||
viewModel.itemShelvingAdd(
|
||||
shelving = shelvingFk,
|
||||
item = itemFk,
|
||||
quantity = visible_calc,
|
||||
|
@ -1038,7 +1025,7 @@ class UbicadorFragment(
|
|||
customDialogTwoButtons.dismiss()
|
||||
customDialog.dismiss()
|
||||
} else {
|
||||
viewModel.itemShelving_selfConsumption(
|
||||
viewModel.itemShelvingSelfConsumption(
|
||||
shelvingFk,
|
||||
item.item,
|
||||
0
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.google.gson.JsonObject
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -40,7 +41,6 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
val loadShelvingList = Transformations.map(_shelvingList) { Event(it) }
|
||||
|
||||
|
||||
private val _reubicationList by lazy { MutableLiveData<ReubicationList>() }
|
||||
val loadReubicationList = Transformations.map(_reubicationList) { Event(it) }
|
||||
|
||||
|
@ -62,29 +62,15 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun itemShelvingList(
|
||||
vShelvingFk: String
|
||||
) {
|
||||
silex.itemShelvingList(vShelvingFk.uppercase())
|
||||
.enqueue(object :
|
||||
SilexCallback<List<ItemUbicadorVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemUbicadorVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemUbicadorVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
)
|
||||
_shelvingList.value = ItemUbicadorListVO(listError)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<List<ItemUbicadorVO>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
salix.itemShelvingList(params = listOf(vShelvingFk.uppercase()).formatWithQuotes())
|
||||
.enqueue(
|
||||
object :
|
||||
SalixCallback<List<ItemUbicadorVO>>(context) {
|
||||
override fun onSuccess(response: Response<List<ItemUbicadorVO>>) {
|
||||
_shelvingList.value = response.body()?.let { ItemUbicadorListVO(it) }
|
||||
} else {
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemUbicadorVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemUbicadorVO(
|
||||
|
@ -92,15 +78,15 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
t.message!!,
|
||||
),
|
||||
),
|
||||
)
|
||||
_shelvingList.value = ItemUbicadorListVO(listError)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fun shelvingPriorityUpdate(
|
||||
|
@ -110,34 +96,38 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
) {
|
||||
salix.updateShelvingPriority(
|
||||
where = JsonObject().apply { addProperty("code", shelving) },
|
||||
params = hashMapOf("priority" to priority)).enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responsepriority.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
params = hashMapOf("priority" to priority)
|
||||
).enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responsepriority.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responsepriority.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responsepriority.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelving_addList(
|
||||
fun itemShelvingAddList(
|
||||
shelving: String,
|
||||
items: Any,
|
||||
isChecking: Boolean,
|
||||
warehouse: Int
|
||||
) {
|
||||
silex.itemShelving_addList(
|
||||
shelving,
|
||||
items,
|
||||
isChecking,
|
||||
warehouse
|
||||
salix.itemShelvingAddList(
|
||||
arrayListOf(shelving, items, isChecking, warehouse).formatWithQuotes()
|
||||
).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseAddList.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseAddList.value = ResponseItemVO(
|
||||
isError = true, errorMessage = getMessageFromAllResponse(
|
||||
|
@ -146,15 +136,10 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseAddList.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelvingMake(
|
||||
fun itemShelvingAdd(
|
||||
shelving: String,
|
||||
item: Number,
|
||||
quantity: Int,
|
||||
|
@ -162,13 +147,16 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
warehouse: Int,
|
||||
grouping: Int?
|
||||
) {
|
||||
silex.itemShelvingMake(
|
||||
shelving,
|
||||
item,
|
||||
quantity,
|
||||
packing,
|
||||
warehouse,
|
||||
grouping
|
||||
salix.itemShelvingAdd(
|
||||
arrayListOf(
|
||||
shelving,
|
||||
item,
|
||||
quantity,
|
||||
null,
|
||||
grouping,
|
||||
packing,
|
||||
warehouse,
|
||||
).formatWithQuotes()
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseMake.value = ResponseItemVO(
|
||||
|
@ -192,10 +180,10 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
grouping: Int?
|
||||
|
||||
) {
|
||||
salix.itemShelvingUpdate(
|
||||
params = ItemShelvingSalix(visible = quantity, packing = packing, grouping = grouping),
|
||||
id = itemShelvingFk,
|
||||
).enqueue(object : SalixCallback<Any>(context) {
|
||||
salix.itemShelvingUpdate(
|
||||
params = ItemShelvingSalix(visible = quantity, packing = packing, grouping = grouping),
|
||||
id = itemShelvingFk,
|
||||
).enqueue(object : SalixCallback<Any>(context) {
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseMake.value = ResponseItemVO(
|
||||
|
@ -212,20 +200,12 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun shelvingPark(
|
||||
|
||||
fun setParking(
|
||||
shelving: String,
|
||||
parking: String
|
||||
) {
|
||||
silex.shelvingPark(shelving, parking)
|
||||
salix.setParking(arrayListOf(shelving, parking).formatWithQuotes())
|
||||
.enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
|
@ -240,26 +220,13 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun shelvingChange(
|
||||
origen: String,
|
||||
destino: String
|
||||
) {
|
||||
silex.shelvingChange(origen, destino)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -270,7 +237,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
) {
|
||||
salix.itemShelvingsUpdate(
|
||||
where = JsonObject().apply { addProperty("id", vShelf) },
|
||||
params = hashMapOf("shelvingFk" to vShelvingFk))
|
||||
params = hashMapOf("shelvingFk" to vShelvingFk)
|
||||
)
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
|
@ -292,7 +260,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
) {
|
||||
salix.itemShelvingsUpdate(
|
||||
where = JsonObject().apply { addProperty("shelvingFk", vShelvingFk) },
|
||||
params = hashMapOf("isChecked" to null))
|
||||
params = hashMapOf("isChecked" to null)
|
||||
)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
|
@ -328,27 +297,6 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun travel_updatePacking(
|
||||
itemFk: Int,
|
||||
packingFk: Int
|
||||
) {
|
||||
silex.travel_updatePacking(itemFk, packingFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun itemShelving_return(
|
||||
shelvingFk: String,
|
||||
|
||||
|
@ -420,7 +368,7 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun shelvingChangeSalix(
|
||||
shelvingFkIn: String,
|
||||
shelvingFkOut:String
|
||||
shelvingFkOut: String
|
||||
|
||||
) {
|
||||
|
||||
|
@ -448,19 +396,19 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
shelvingFk: String
|
||||
|
||||
) {
|
||||
silex.itemShelvingTransfer(itemFk, shelvingFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
salix.itemShelvingTransfer(arrayListOf(itemFk, shelvingFk).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!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -483,22 +431,27 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun itemShelving_selfConsumption(shelvingFk: String, itemFk: Int, quantity: Int) {
|
||||
silex.itemShelving_selfConsumption(shelvingFk, itemFk, quantity)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
fun itemShelvingSelfConsumption(shelvingFk: String, itemFk: Int, quantity: Int) {
|
||||
salix.itemShelvingSelfConsumption(
|
||||
arrayListOf(
|
||||
shelvingFk,
|
||||
itemFk,
|
||||
quantity
|
||||
).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!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -514,7 +467,6 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
override fun onSuccess(response: Response<String?>) {
|
||||
|
||||
|
||||
if (response.body() == null) {
|
||||
_responseCode.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
|
|
@ -43,7 +43,6 @@ class WorkermistakeFragment(
|
|||
private var listMistakesAdapter: BarcodeAdapter? = null
|
||||
private var workerMistakeName: WorkerFromMistake? = null
|
||||
|
||||
|
||||
private val departments = ArrayList<SearchDepartmentModel>()
|
||||
private lateinit var departmentId: String
|
||||
|
||||
|
@ -60,15 +59,13 @@ class WorkermistakeFragment(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
viewModel.department_getHasMistake()
|
||||
viewModel.department_getHasMistake()
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
|
||||
binding.filterDepartment.setText(getData(DEPARTMENTMISTAKE))
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
departmentId = getData(DEPARTMENTMISTAKEID)
|
||||
|
@ -76,7 +73,7 @@ class WorkermistakeFragment(
|
|||
customDialogList = CustomDialogList(requireContext())
|
||||
|
||||
if (!departmentId.isEmpty()) {
|
||||
viewModel.worker_getFromHasMistake(
|
||||
viewModel.workerGetFromHasMistake(
|
||||
getData(DEPARTMENTMISTAKEID).toInt()
|
||||
)
|
||||
}
|
||||
|
@ -93,7 +90,7 @@ class WorkermistakeFragment(
|
|||
|
||||
saveData(DEPARTMENTMISTAKE, nombre.getDepartmentName())
|
||||
saveData(DEPARTMENTMISTAKEID, nombre.getDepartmentId())
|
||||
viewModel.worker_getFromHasMistake(
|
||||
viewModel.workerGetFromHasMistake(
|
||||
nombre.getDepartmentId()
|
||||
)
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
|
@ -144,7 +141,6 @@ class WorkermistakeFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* override fun onPause() {
|
||||
super.onPause()
|
||||
firstVisiblePosition = layoutManager?.findFirstVisibleItemPosition() ?: 0
|
||||
|
@ -161,47 +157,36 @@ class WorkermistakeFragment(
|
|||
|
||||
override fun observeViewModel() {
|
||||
with(viewModel) {
|
||||
|
||||
|
||||
mistakeDepartmentList.observe(viewLifecycleOwner, {
|
||||
mistakeDepartmentList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createDepartmentList(it.list)
|
||||
}
|
||||
|
||||
})
|
||||
workerFromMistakeList.observe(viewLifecycleOwner, {
|
||||
workerFromMistakeList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
createWorkerList(it.list)
|
||||
|
||||
adapterworker =
|
||||
WorkermistakeAdapter(listWorker, object : onMistakeWorkerClickListener {
|
||||
|
||||
override fun onMistakeWorkerClickListener(item: WorkerFromMistake) {
|
||||
viewModel.workerMistakeType_get(
|
||||
|
||||
)
|
||||
workerMistakeName =
|
||||
WorkerFromMistake(item.id, item.firstName, item.lastName, true, "")
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
binding.workermistakeRecyclerview.adapter = adapterworker
|
||||
layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.workermistakeRecyclerview.layoutManager = layoutManager
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
mistakeWorkerList.observe(viewLifecycleOwner, {
|
||||
mistakeWorkerList.observe(viewLifecycleOwner) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
showMistakeList(it.list)
|
||||
//goBack = false
|
||||
|
||||
})
|
||||
|
||||
responseAddMistake.observe(viewLifecycleOwner, {
|
||||
|
||||
}
|
||||
|
||||
responseAddMistake.observe(viewLifecycleOwner) {
|
||||
ma.messageWithSound(
|
||||
if (it.isError) {
|
||||
if (it.codeError == 403) {
|
||||
|
@ -209,24 +194,20 @@ class WorkermistakeFragment(
|
|||
} else {
|
||||
it.errorMessage
|
||||
}
|
||||
|
||||
} else {
|
||||
getString(R.string.errorCauseRegistered)
|
||||
}, it.isError, true, isToasted = true
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, {
|
||||
response.observe(viewLifecycleOwner) {
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, true, false)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showMistakeList(list: List<MistakeType>) {
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
listMistakes = ArrayList()
|
||||
|
@ -254,7 +235,7 @@ class WorkermistakeFragment(
|
|||
vUserFk = workerMistakeName!!.id!!,
|
||||
vTypeFk = it.code
|
||||
)
|
||||
customDialogList.dismiss()
|
||||
customDialogList.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +249,6 @@ class WorkermistakeFragment(
|
|||
|
||||
}
|
||||
|
||||
|
||||
private fun createDepartmentList(list: List<DepartmentMistake>) {
|
||||
departments.clear()
|
||||
list.forEach { department ->
|
||||
|
|
|
@ -49,9 +49,7 @@
|
|||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_chevron_right_black_24dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -76,8 +74,6 @@
|
|||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -102,22 +98,15 @@
|
|||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/historico_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
tools:listitem="@layout/item_historico_row"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
' <include
|
||||
<include
|
||||
android:id="@+id/main_toolbar"
|
||||
layout="@layout/toolbar_fragment"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -216,6 +216,7 @@
|
|||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toStartOf="@+id/item_packing_itemFk"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_article_itemFk"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -233,6 +234,7 @@
|
|||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_packing_text"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{String.valueOf(item.ETD)}"
|
||||
android:text="@{String.valueOf(item.eta)}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
|
@ -8,69 +7,74 @@
|
|||
name="item"
|
||||
type="es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_row_layout"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/verdnatura_black_5"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/layout_margin_min"
|
||||
android:paddingRight="@dimen/layout_margin_min"
|
||||
android:paddingTop="@dimen/pasilleros_margin_main_menu"
|
||||
android:paddingRight="@dimen/layout_margin_min"
|
||||
android:paddingBottom="@dimen/pasilleros_margin_main_menu">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/historico_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/layout_margin_min"
|
||||
android:gravity="left"
|
||||
android:text="@{item.shipped}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="@dimen/layout_margin_min"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.name}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{String.valueOf(item.invalue)}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{String.valueOf(item.out)}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{String.valueOf(item.balance)}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
android:textSize="@dimen/body2" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="@{item.name}"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{String.valueOf(item.invalue)}"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{String.valueOf(item.out)}"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{String.valueOf(item.balance)}"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/body2" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/verdnatura_black_9"/>
|
||||
android:background="@color/verdnatura_black_9" />
|
||||
</LinearLayout>
|
||||
</layout>
|
|
@ -686,6 +686,10 @@
|
|||
<string name="errorFile">Problemas al intentar abrir/crear el fichero</string>
|
||||
<string name="errorScanExpedition">Error al escanear expedición</string>
|
||||
<string name="NotAddress">No hay consignatarios para dar de baja el ítem</string>
|
||||
<string name="packagesNotScanned">Bultos escaneados no guardados</string>
|
||||
<string name="savePackages">Para guardar pulsa el icono del tick de la parte superior. ¿Quieres guardarlos?</string>
|
||||
<string name="yes">SI</string>
|
||||
<string name="no">NO</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -686,6 +686,10 @@
|
|||
<string name="errorFile">Problemas al intentar abrir/crear el fichero</string>
|
||||
<string name="errorScanExpedition">Error al escanear expedición</string>
|
||||
<string name="NotAddress">No hay consignatarios para dar de baja el ítem</string>
|
||||
<string name="packagesNotScanned">Colis non scannés</string>
|
||||
<string name="savePackages">Pour sauvegarder, appuyez sur l\'icône de coche en haut. Voulez-vous les sauvegarder ?</string>
|
||||
<string name="yes">OUI</string>
|
||||
<string name="no">NON</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue