Skip to content

FINERACT-2752: Charge - Income from charge list is not the same on add and edit mode - #6253

Open
rymghosn wants to merge 1 commit into
apache:developfrom
foodeveloper:port/CBS-129-charge-income-account-list-mismatch
Open

FINERACT-2752: Charge - Income from charge list is not the same on add and edit mode#6253
rymghosn wants to merge 1 commit into
apache:developfrom
foodeveloper:port/CBS-129-charge-income-account-list-mismatch

Conversation

@rymghosn

Copy link
Copy Markdown
Contributor

When creating a charge with chargeAppliesTo = Client and selecting an item from the "Income from Charge" (GL income account) list, editing that
charge afterwards showed the previously selected income account as missing, and reopening the dropdown showed fewer available options than
before.

Root cause: ChargeWritePlatformServiceJpaRepositoryImpl#updateCharge persisted the updated charge with a plain chargeRepository.save(). This
defers the actual flush to Hibernate's own timing, so when the same request cycle immediately re-read the charge to build the response (or to
populate the edit-mode dropdown), it could still see the pre-update state — making the income account selection look reverted or absent.

Fix:

  • updateCharge now calls chargeRepository.saveAndFlush() instead of save(), so the change is flushed before the charge is re-read.
  • Added the missing incomeAccountId field to ChargeRequest so the API request DTO accurately reflects the incomeAccountId parameter the service
    already accepts (ChargesApiConstants.glAccountIdParamName).
    PR:(https://issues.apache.org/jira/browse/FINERACT-2752)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant