rymghosn commented on PR #6253: URL: https://github.com/apache/fineract/pull/6253#issuecomment-5992512755
@adamsaghy You're right, sorry: `saveAndFlush` changed nothing, and the description's flush-timing explanation was wrong. I've reverted it to `save` and dropped the debug log line. I went back and found the real cause. `ChargesApiResource#createCharge`/`#updateCharge` bind the body to `ChargeRequest` and re-serialize it, and `ChargeRequest` had no `incomeAccountId` field. The income account the UI sends was dropped before the command ran, so the charge was stored without one, and edit mode had nothing to select. On unmodified `develop`, creating a client charge with `incomeAccountId` and then reading it with `?template=true` returns `incomeOrLiabilityAccount: null`. With the field added, it returns the chosen account. The add-mode and edit-mode option lists were identical all along. The PR is now just the `ChargeRequest.incomeAccountId` field plus an integration test (`ChargesTest.testClientChargeKeepsIncomeAccountOnCreateAndUpdate`). It covers create, the edit-mode template (same income options as add mode, selected account included) and changing the account on update. It's rebased onto the latest `develop`, and the description is rewritten to match. Could you please re-review? Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
