diff --git a/packages/registration_delivery/lib/data/repositories/local/household.dart b/packages/registration_delivery/lib/data/repositories/local/household.dart index 8e1996987..1607f1d8e 100644 --- a/packages/registration_delivery/lib/data/repositories/local/household.dart +++ b/packages/registration_delivery/lib/data/repositories/local/household.dart @@ -70,6 +70,7 @@ class HouseholdLocalRepository return HouseholdModel( id: household.id, + householdType: household.householdType, tenantId: household.tenantId, clientReferenceId: household.clientReferenceId, memberCount: household.memberCount, diff --git a/packages/registration_delivery/lib/data/repositories/local/individual_global_search.dart b/packages/registration_delivery/lib/data/repositories/local/individual_global_search.dart index cdd3281e5..b0cd8045b 100644 --- a/packages/registration_delivery/lib/data/repositories/local/individual_global_search.dart +++ b/packages/registration_delivery/lib/data/repositories/local/individual_global_search.dart @@ -183,7 +183,7 @@ class IndividualGlobalSearchRepository extends LocalRepository { .equalsExp(sql.individual.clientReferenceId)) ]) ..where(buildAnd([ - if (params.householdType == HouseholdType.community) + if (params.householdType == HouseholdType.community && params.householdClientReferenceId==null) sql.householdMember.isHeadOfHousehold.equals(true), sql.address.relatedClientReferenceId.isNotNull(), sql.individual.clientReferenceId.isNotNull(), @@ -284,7 +284,7 @@ class IndividualGlobalSearchRepository extends LocalRepository { sql.projectBeneficiary.beneficiaryClientReferenceId .equalsExp(sql.household.clientReferenceId)) ]).where(buildAnd([ - if (params.householdType == HouseholdType.community) + if (params.householdType == HouseholdType.community && params.householdClientReferenceId==null) sql.householdMember.isHeadOfHousehold.equals(true), sql.household.householdType.equalsValue(params.householdType) ])); diff --git a/packages/registration_delivery/lib/pages/search_beneficiary.dart b/packages/registration_delivery/lib/pages/search_beneficiary.dart index 129ee0f45..922223436 100644 --- a/packages/registration_delivery/lib/pages/search_beneficiary.dart +++ b/packages/registration_delivery/lib/pages/search_beneficiary.dart @@ -362,8 +362,14 @@ class _SearchBeneficiaryPageState ? i.projectBeneficiaries ?.lastOrNull : null, - addressModel: i.headOfHousehold! - .address!.lastOrNull!, + addressModel: + (RegistrationDeliverySingleton() + .householdType == + HouseholdType + .community) + ? i.household!.address! + : i.headOfHousehold! + .address!.lastOrNull!, headOfHousehold: i.headOfHousehold), ), diff --git a/packages/registration_delivery/lib/pages/summary_page.dart b/packages/registration_delivery/lib/pages/summary_page.dart index a48355478..c12bbfc67 100644 --- a/packages/registration_delivery/lib/pages/summary_page.dart +++ b/packages/registration_delivery/lib/pages/summary_page.dart @@ -214,10 +214,10 @@ class SummaryPageState extends LocalizedState { LabelValueItem( label: localizations.translate( i18.householdLocation.villageLabel), - value: householdState.householdModel - ?.address?.locality?.code ?? - localizations - .translate(i18.common.coreCommonNA), + value: localizations.translate( + householdState.householdModel?.address + ?.locality?.code ?? + i18.common.coreCommonNA), isInline: true, labelFlex: 5, ), @@ -366,6 +366,7 @@ class SummaryPageState extends LocalizedState { individualModel?.name?.givenName ?? localizations.translate( i18.common.coreCommonNA)), + labelFlex: 5, ), LabelValueItem( label: localizations.translate(