From 37efc5b858862ee2b8535656edc7d6bd48af8eb4 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Tue, 2 Jun 2026 01:33:24 -0400 Subject: [PATCH] feat(fusion_portal): funding-source selector on accessibility forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reps can now mark an accessibility assessment's funding source on the web form (Private / March of Dimes / ODSP / WSIB / Hardship / Insurance / Other) so the generated draft sale order routes to the correct funding pipeline instead of always defaulting to private pay. Adds Hardship to the x_fc_funding_source selection + sale_type_map; the new form ` (options mirror the model selection; `direct_private` pre-selected so existing private behaviour is unchanged) right after the phone/email row, before the card closes. +- [ ] **Step 2:** Validate XML well-formedness (`[xml]` parse). +- [ ] **Step 3:** Commit. + +### Task 3: Capture funding_source in the save controller + +**Files:** Modify `fusion_portal/controllers/portal_main.py` (`accessibility_assessment_save` vals, ~:2498-2511) + +- [ ] **Step 1:** Add `'x_fc_funding_source': post.get('funding_source') or 'direct_private',` to the `vals` dict. +- [ ] **Step 2:** `python -m pyflakes fusion_portal/controllers/portal_main.py` → no new undefined-name errors. +- [ ] **Step 3:** Commit. + +### Task 4: Verify + ship + +- [ ] **Step 1:** Grep confirms `funding_source` flows form → controller → `x_fc_funding_source` → `sale_type_map`. +- [ ] **Step 2:** Deploy to westin (backup → scp the 3 files → `-u fusion_portal` → cache-bust → restart) and confirm: open `/my/accessibility/stairlift/straight`, pick "March of Dimes", complete → the new SO shows `x_fc_sale_type = march_of_dimes` and appears in the MOD pipeline. diff --git a/fusion_portal/controllers/portal_main.py b/fusion_portal/controllers/portal_main.py index c85ce960..b5f65b51 100644 --- a/fusion_portal/controllers/portal_main.py +++ b/fusion_portal/controllers/portal_main.py @@ -2507,6 +2507,7 @@ class AuthorizerPortal(CustomerPortal): 'client_address_postal': post.get('client_address_postal', '').strip(), 'client_phone': post.get('client_phone', '').strip(), 'client_email': post.get('client_email', '').strip(), + 'x_fc_funding_source': post.get('funding_source') or 'direct_private', 'notes': post.get('notes', '').strip(), } diff --git a/fusion_portal/models/accessibility_assessment.py b/fusion_portal/models/accessibility_assessment.py index 4d18df1d..10a5534d 100644 --- a/fusion_portal/models/accessibility_assessment.py +++ b/fusion_portal/models/accessibility_assessment.py @@ -73,6 +73,7 @@ class FusionAccessibilityAssessment(models.Model): ('march_of_dimes', 'March of Dimes'), ('odsp', 'ODSP'), ('wsib', 'WSIB'), + ('hardship', 'Hardship Funding'), ('insurance', 'Private Insurance'), ('direct_private', 'Private Pay (Direct)'), ('other', 'Other'), @@ -772,6 +773,7 @@ class FusionAccessibilityAssessment(models.Model): 'march_of_dimes': 'march_of_dimes', 'odsp': 'odsp', 'wsib': 'wsib', + 'hardship': 'hardship', 'insurance': 'insurance', 'direct_private': 'direct_private', 'other': 'other', diff --git a/fusion_portal/views/portal_accessibility_templates.xml b/fusion_portal/views/portal_accessibility_templates.xml index 18484565..fcd1d35f 100644 --- a/fusion_portal/views/portal_accessibility_templates.xml +++ b/fusion_portal/views/portal_accessibility_templates.xml @@ -373,6 +373,21 @@ +
+
+ + + Determines which sale order / funding workflow this case enters. +
+