From a8a19ea671d8427b7215cef411e5c9ff6a154c9a Mon Sep 17 00:00:00 2001 From: Roman Karpovich Date: Tue, 7 May 2024 19:07:49 +0800 Subject: [PATCH] update labels for engagement dates --- .../commands/update_audit_permissions.py | 3 --- .../migrations/0031_auto_20240507_1059.py | 23 +++++++++++++++++++ src/etools/applications/audit/models.py | 4 ++-- .../audit/serializers/engagement.py | 9 ++++---- 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 src/etools/applications/audit/migrations/0031_auto_20240507_1059.py diff --git a/src/etools/applications/audit/management/commands/update_audit_permissions.py b/src/etools/applications/audit/management/commands/update_audit_permissions.py index 1cc9d56363..d37bb7f4e2 100644 --- a/src/etools/applications/audit/management/commands/update_audit_permissions.py +++ b/src/etools/applications/audit/management/commands/update_audit_permissions.py @@ -62,9 +62,6 @@ class Command(BaseCommand): 'audit.engagement.status', 'audit.engagement.status_date', - 'audit.spotcheck.face_form_start_date', - 'audit.spotcheck.face_form_end_date', - 'purchase_order.purchaseorder.*', 'purchase_order.auditorfirm.*', ] diff --git a/src/etools/applications/audit/migrations/0031_auto_20240507_1059.py b/src/etools/applications/audit/migrations/0031_auto_20240507_1059.py new file mode 100644 index 0000000000..5131816108 --- /dev/null +++ b/src/etools/applications/audit/migrations/0031_auto_20240507_1059.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.19 on 2024-05-07 10:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('audit', '0030_engagement_send_back_comment'), + ] + + operations = [ + migrations.AlterField( + model_name='engagement', + name='end_date', + field=models.DateField(blank=True, null=True, verbose_name='Start date of first reporting FACE'), + ), + migrations.AlterField( + model_name='engagement', + name='start_date', + field=models.DateField(blank=True, null=True, verbose_name='End date of last reporting FACE'), + ), + ] diff --git a/src/etools/applications/audit/models.py b/src/etools/applications/audit/models.py index ea9ff2e2c8..329d4cd2f5 100644 --- a/src/etools/applications/audit/models.py +++ b/src/etools/applications/audit/models.py @@ -111,8 +111,8 @@ class Engagement(InheritedModelMixin, TimeStampedModel, models.Model): ) partner_contacted_at = models.DateField(verbose_name=_('Date IP was contacted'), blank=True, null=True) engagement_type = models.CharField(verbose_name=_('Engagement Type'), max_length=10, choices=TYPES) - start_date = models.DateField(verbose_name=_('Period Start Date'), blank=True, null=True) - end_date = models.DateField(verbose_name=_('Period End Date'), blank=True, null=True) + start_date = models.DateField(verbose_name=_('Start date of first reporting FACE'), blank=True, null=True) + end_date = models.DateField(verbose_name=_('End date of last reporting FACE'), blank=True, null=True) total_value = models.DecimalField( verbose_name=_('Total value of selected FACE form(s)'), default=0, decimal_places=2, max_digits=20 ) diff --git a/src/etools/applications/audit/serializers/engagement.py b/src/etools/applications/audit/serializers/engagement.py index 3c22249d5a..6ecbb2336a 100644 --- a/src/etools/applications/audit/serializers/engagement.py +++ b/src/etools/applications/audit/serializers/engagement.py @@ -257,6 +257,9 @@ class EngagementSerializer( WritableNestedParentSerializerMixin, EngagementListSerializer ): + face_form_start_date = serializers.DateField(label='FACE Form(s) Start Date', read_only=True, source='start_date') + face_form_end_date = serializers.DateField(label='FACE Form(s) End Date', read_only=True, source='end_date') + staff_members = SeparatedReadWriteField( read_field=serializers.SerializerMethodField(), label=_('Audit Staff Team Members') @@ -287,6 +290,7 @@ class EngagementSerializer( class Meta(EngagementListSerializer.Meta): fields = EngagementListSerializer.Meta.fields + [ + 'face_form_start_date', 'face_form_end_date', 'total_value', 'staff_members', 'active_pd', 'authorized_officers', 'users_notified', 'joint_audit', 'year_of_audit', 'shared_ip_with', 'exchange_rate', 'currency_of_report', 'start_date', 'end_date', 'partner_contacted_at', 'date_of_field_visit', 'date_of_draft_report_to_ip', @@ -399,16 +403,13 @@ class Meta(WritableNestedSerializerMixin.Meta): class SpotCheckSerializer(ActivePDValidationMixin, EngagementSerializer): findings = FindingSerializer(many=True, required=False) - face_form_start_date = serializers.DateField(label='FACE Form(s) Start Date', read_only=True, source='start_date') - face_form_end_date = serializers.DateField(label='FACE Form(s) End Date', read_only=True, source='end_date') - pending_unsupported_amount = serializers.DecimalField(20, 2, label=_('Pending Unsupported Amount'), read_only=True) class Meta(EngagementSerializer.Meta): model = SpotCheck fields = EngagementSerializer.Meta.fields + [ 'total_amount_tested', 'total_amount_of_ineligible_expenditure', - 'internal_controls', 'findings', 'face_form_start_date', 'face_form_end_date', + 'internal_controls', 'findings', 'amount_refunded', 'additional_supporting_documentation_provided', 'justification_provided_and_accepted', 'write_off_required', 'pending_unsupported_amount', 'explanation_for_additional_information'