diff --git a/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart b/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart index 548d47bb..79b8b162 100644 --- a/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart +++ b/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart @@ -73,6 +73,8 @@ class SparePartHelperModel { data['partCatalogItemId'] = sparePart?.id; data['quantity'] = quantity; data['comment'] = comment; + data['installQty'] = installQty; + data['returnQty'] = returnQty; if (sparePartAttachments.isNotEmpty) { data['acitiySparePartAttachments'] = sparePartAttachments!.map((v) => v.toJson()).toList(); } diff --git a/lib/modules/pm_module/ppm_wo/activities/pm_activities_list_view.dart b/lib/modules/pm_module/ppm_wo/activities/pm_activities_list_view.dart index fa749597..bf8527e0 100644 --- a/lib/modules/pm_module/ppm_wo/activities/pm_activities_list_view.dart +++ b/lib/modules/pm_module/ppm_wo/activities/pm_activities_list_view.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:test_sa/controllers/api_routes/urls.dart'; @@ -77,8 +76,7 @@ class _PmActivitiesListViewState extends State { return sparePartActivityCard(pmProvider: pmProvider, userProvider: userProvider, context: context, activity: activities[index]); }, ).expanded, - if (userProvider.user!.type == UsersTypes.engineer && - (pmProvider.planPreventiveVisit?.visitStatus?.value != 5 && pmProvider.planPreventiveVisit?.visitStatus?.value != 3)) + if (userProvider.user!.type == UsersTypes.engineer && (pmProvider.planPreventiveVisit?.visitStatus?.value != 5 && pmProvider.planPreventiveVisit?.visitStatus?.value != 3)) FooterActionButton.footerContainer( context: context, child: AppFilledButton( @@ -165,13 +163,28 @@ class _PmActivitiesListViewState extends State { label: context.translation.oracleCode, value: activity.partCatalogItem?.oracleCode, ), + if (activity.quantity != null && activity.quantity! > 0) + InfoTextWidget( + label: context.translation.quantity, + value: activity.quantity.toString(), + ), + if (activity.installQty != null && activity.installQty! > 0) + InfoTextWidget( + label: context.translation.installedQty, + value: activity.installQty.toString(), + ), + if (activity.returnQty != null && activity.returnQty! > 0) + InfoTextWidget( + label: context.translation.returnQty, + value: activity.returnQty.toString(), + ), if (activity.comment?.isNotEmpty ?? false) ...[ const Divider().defaultStyle(context), InfoTextLabelWidget(label: activity.comment ?? ""), ], if (activity.activitySparePartPPMAttachments.isNotEmpty) ...[ const Divider().defaultStyle(context), - FilesList(images: activity.activitySparePartPPMAttachments.map((toElement) => URLs.getFileUrl(toElement.name??'')??'').toList()), + FilesList(images: activity.activitySparePartPPMAttachments.map((toElement) => URLs.getFileUrl(toElement.name ?? '') ?? '').toList()), ], ], ).toShadowContainer(context, showShadow: false).onPress(() {