Hi All,
We would like to display an error to the user if the Project Budget exceeds while adding the details in Purchase Order and stop them from removing it from hold.
Acumatica does some calculation on page load and displays a warning when the budget is exceeded as shown below:
This is the budget in the project:
For the Project, Project Task, Cost Code and Account Group combination, the budget in project is 1500 but in PO is 1501, so it is displaying the warning message.
There are other logic as well which I do not know yet and it is complex if I have to replicate the logic.
My job is to see if the budget is exceeded or not if it is exceeding, I need to give a message to user and stop from proceeding further.
Things I have tried:
- Tried to implement the logic by myself but I am missing certain scenarios like the line item in PO can be marked as closed/cancelled, so they need to be treated differently.
- Catch the warning and show it as an error but the warning message is inconsistent. There are many instances where the warning was not shown although the budget exceeded and after reload it comes back.
From my analysis the code from Acumatica is in class BudgetControlGraph. Is there a way I could re-use the logic or replicate it for my requirement and How?