NDIS-850: NDIS Plan Sync - Issue with Plan Budget Mapping
Fix: Mapping of Management type on Plan Budget
The maica_Plan_Budget.maica__Mangement_Type_c
field was not correctly mapped to the values received from the NDIS API. The field was previously hardcoded to "Plan Managed" instead of dynamically mapping the values from the received payload.
What’s Changed?
- Implemented a mapping between
plan_management_text
values in the NDIS response and maica__Plan_Management_c
field in Maica. - Updated code in
NDISPlanBudgets.cls
to properly map and store the plan management type. - Unit tests were extended to validate the mapping.
Mapping Implemented
ZCOR_PLAN
→ "Core Plan Managed"ZCAT_PLAN
→ "Capital Plan Managed"ZCAP_PLAN
→ "Capacity Building Plan Managed"
Testing & Validation
- The implementation was validated through unit tests.
- Peer review and QA were completed before merging into production.
NDIS-834: NDIS - Support Agreement Items with odd utilization values
Fix: Incorrect Utilisation Calculations on Agreement Items
We resolved an issue where Agreement Items displayed incorrect utilisation percentages and negative remaining balances due to inconsistencies in how Quantity
and Unit Price
were ratioed in relation to Invoice Line Item
records. This fix ensures accurate financial calculations, preventing over-utilisation errors and incorrect funding balances.
What’s Changed?
- New Quantity Delivered Field for Accurate Roll-Ups: Introduced
Quantity Delivered
field on Invoice Line Item
and Delivery Activity
. This field captures the actual ratioed quantity, ensuring correct utilisation calculations. Roll-ups on Agreement Item
now sum Quantity Delivered
instead of Quantity
. - Fixed Total Allocated and Utilisation Field Calculations: Previously,
Total Allocated
was fluctuating due to the way Quantity Remaining
was being calculated. The calculation now follows a fixed formula: Total Allocated = Quantity Remaining * Rate + Total Delivered
. Utilisation is now correctly calculated as: Total Delivered / Total Allocated
. The value can now exceed 100% only when services have been over-delivered, preventing incorrect negative values. - Post-Update Data Correction: A post-installation script will be executed to recalculate all existing
Invoice Line Item
and Agreement Item
records to ensure accurate roll-ups. Any previously impacted records will be automatically corrected.
Post Installation Scripts: Client Management ONLY
The section of below scripts apply if you are on Client Management ONLY, if you use Client Management & Delivery, skip to the
next section.
Please
ensure you complete the following Post Install Scripts
in the order they are provided. If you require assistance with installing or running this script, please
contact Maica Support for guidance.
Script to UPDATE Invoice Line Items
update [SELECT Id FROM maica__Invoice_Line_Item__c];
Script to UPDATE Agreement Items
update [SELECT Id FROM maica__Agreement_Item__c];
Post Installation Scripts: Client Management & Client Delivery
If you are on Maica Client Delivery as well as Maica Client Management, please use the below scripts. If you are on Client Management ONLY, please ignore the below section.
Note: When running these scripts, please wait until the first Job has been completed before starting the second Script. You can track the progress of the Job in your Salesforce instance by going to Setup --> Apex Jobs.
If you require assistance with installing or running this script, please
contact Maica Support for guidance.
Script to UPDATE Invoice Line Items
new maica.vertic_UpdateRecordsBatch(maica__Invoice_Line_Item__c.SObjectType, 'Id != NULL').setOptAllOrNone(false).run();
Script to UPDATE Agreement Items
new maica.vertic_UpdateRecordsBatch(maica__Agreement_Item__c.SObjectType, 'Id != NULL').setOptAllOrNone(false).run();