diff --git a/hypha/apply/projects/forms/payment.py b/hypha/apply/projects/forms/payment.py index ecc01ce231a6b166d110289357754007bbe72394..3f4a46826cb8589919b3c3aca252a7a0d09b0801 100644 --- a/hypha/apply/projects/forms/payment.py +++ b/hypha/apply/projects/forms/payment.py @@ -49,18 +49,18 @@ class ChangeInvoiceStatusForm(forms.ModelForm): CHANGES_REQUESTED_BY_STAFF: filter_request_choices([DECLINED], user_choices), APPROVED_BY_STAFF: filter_request_choices( [ - CHANGES_REQUESTED_BY_FINANCE_1, APPROVED_BY_FINANCE_1, DECLINED, + CHANGES_REQUESTED_BY_FINANCE_1, APPROVED_BY_FINANCE_1, ], user_choices ), CHANGES_REQUESTED_BY_FINANCE_1: filter_request_choices([CHANGES_REQUESTED_BY_STAFF, DECLINED], user_choices), CHANGES_REQUESTED_BY_FINANCE_2: filter_request_choices( [ - CHANGES_REQUESTED_BY_FINANCE_1, APPROVED_BY_FINANCE_1, DECLINED + CHANGES_REQUESTED_BY_FINANCE_1, APPROVED_BY_FINANCE_1, ], user_choices ), - APPROVED_BY_FINANCE_1: filter_request_choices([CHANGES_REQUESTED_BY_FINANCE_2, APPROVED_BY_FINANCE_2, DECLINED], user_choices), + APPROVED_BY_FINANCE_1: filter_request_choices([CHANGES_REQUESTED_BY_FINANCE_2, APPROVED_BY_FINANCE_2], user_choices), } status_field.choices = possible_status_transitions_lut.get(instance.status, []) diff --git a/hypha/apply/projects/models/payment.py b/hypha/apply/projects/models/payment.py index 94ac5b67b744c7736a3df7625dcd4f0f57a4b0cb..8cdc4829629c3300373cf61ae0210907ff712329 100644 --- a/hypha/apply/projects/models/payment.py +++ b/hypha/apply/projects/models/payment.py @@ -45,8 +45,8 @@ INVOICE_TRANISTION_TO_RESUBMITTED = [ ] INVOICE_STATUS_PM_CHOICES = [CHANGES_REQUESTED_BY_STAFF, APPROVED_BY_STAFF, DECLINED] -INVOICE_STATUS_FINANCE_1_CHOICES = [CHANGES_REQUESTED_BY_FINANCE_1, APPROVED_BY_FINANCE_1, DECLINED] -INVOICE_STATUS_FINANCE_2_CHOICES = [CHANGES_REQUESTED_BY_FINANCE_2, APPROVED_BY_FINANCE_2, PAID, DECLINED] +INVOICE_STATUS_FINANCE_1_CHOICES = [CHANGES_REQUESTED_BY_FINANCE_1, APPROVED_BY_FINANCE_1] +INVOICE_STATUS_FINANCE_2_CHOICES = [CHANGES_REQUESTED_BY_FINANCE_2, APPROVED_BY_FINANCE_2, PAID] def invoice_status_user_choices(user): @@ -214,11 +214,11 @@ class Invoice(models.Model): return True if user.is_finance_level_1: - if self.status in {APPROVED_BY_STAFF, CHANGES_REQUESTED_BY_FINANCE_1, CHANGES_REQUESTED_BY_FINANCE_2}: + if self.status in {APPROVED_BY_STAFF, CHANGES_REQUESTED_BY_FINANCE_2}: return True if user.is_finance_level_2: - if self.status in {CHANGES_REQUESTED_BY_FINANCE_2, APPROVED_BY_FINANCE_1}: + if self.status in {APPROVED_BY_FINANCE_1}: return True return False