Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent importing budget data for locked accounts #7449

Conversation

jmcameron
Copy link
Collaborator

Although PR #7435 prevents the budget module from displaying locked accounts, it did not prevent budget imports from doing that.

This PR prevents importing budget data that includes accounts that are locked. It errors out and prints an error message.

Closes #7439

TESTING

  • Use bhima_test, rebuild the database (npm run build:db)
  • Use the Finance > Budget Management > Menu > Export YTD Budget Data (CSV)
  • Edit the exported CSV and add a budget to several accounts such as 7011* (Vente...)
  • In BHIMA, use the Finance > Budget Management > Menu > Import Bdget CSV file. This should work.
  • In the Finance > Account Management page, lock an account, such as 70112010 Vente d'actifs
  • Return to the Finance > Budget Management page. The locked account should not be visible.
  • Try importing the same CSV file as before. It should fail with a message showing which account is locked. At this point, all the exiting budget data for the FY should be erased.
  • Edit the CSV file and remove the line for the locked account.
  • Repeat trying to import the BUDGET data. It should work this time

Copy link
Collaborator

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcameron the feature works as expected, but it seems like we cannot import the account, even if its value is zero, so we can conclude the budget module does not display a locked account.

@jmcameron
Copy link
Collaborator Author

@jmcameron the feature works as expected, but it seems like we cannot import the account, even if its value is zero, so we can conclude the budget module does not display a locked account.

Right. The main budget display does not show locked accounts or include them in the budget and actuals computations. That was implemented in the last PR. This budget prevents anyone from importing CSV budget data for locked accounts. As I understand it, old obsolete accounts are never deleted, they are just marked as locked (and perhaps hidden). So it does not make sense to allow them in the budget imports.

@mbayopanda
Copy link
Collaborator

LGTM 👍🏽

@jmcameron jmcameron merged commit 8e534a6 into Third-Culture-Software:master Jan 31, 2024
2 checks passed
@jmcameron jmcameron deleted the prevent-budget-import-locked-accounts branch January 31, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent importing budget data for locked accounts
2 participants