From 937b06c19866df3b03e7c3ecabc67ff1d860458d Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Wed, 16 Oct 2024 13:45:53 +0200 Subject: [PATCH] feat: refs #5216 changeState --- .../feature/delivery/fragments/LoadUnloadFragment.kt | 10 +++++++--- .../view/feature/delivery/fragments/SummaryFragment.kt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LoadUnloadFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LoadUnloadFragment.kt index d6aa5268..bbed5251 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LoadUnloadFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/LoadUnloadFragment.kt @@ -182,11 +182,13 @@ class LoadUnloadFragment( for (l in list) { mlist.add( ExpeditionSalix( - expeditionFk = l.id, stateCode = if (l.code != state && l.code != "FOUND") { + expeditionFk = l.id, + stateCode = if (l.code != state && l.code != "FOUND" && l.code != "DELIVERED") { "LOST" } else { l.code - }, isScanned = l.isScanned + }, + isScanned = l.isScanned ) ) } @@ -459,7 +461,9 @@ class LoadUnloadFragment( binding.expeditionloadunloadRecyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) binding.mainToolbar.toolbarSubtitle.text = getString( - R.string.summaryCount, myList.filter { it.code == state }.size, myList.size + R.string.summaryCount, + myList.filter { it.code == state || it.code == "DELIVERED" }.size, + myList.size ) setListPosition(myList) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/SummaryFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/SummaryFragment.kt index dbb54ca8..6a6b690b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/SummaryFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/fragments/SummaryFragment.kt @@ -152,7 +152,7 @@ class SummaryFragment( ) { val listExpedition = list.filter { it.addressFk == address }.map { l -> ExpeditionSalix( - expeditionFk = l.id, stateCode = if (l.code == state) { + expeditionFk = l.id, stateCode = if (l.code == state && l.code != "DELIVERED") { state } else { "FOUND"