In my billing application, each time the user generates an invoice, a new entry is written in the “BillingCycles” entity, and the generated invoice lines in the “Billings” entity.
I am working on a new screen which allows the user to create manual adjustments on the system generated invoice (which corresponds to one billing cycle and many billing lines)
In the pending invoice screen (screenshot attached), the user selects the billing cycle and the system displays the generated billing lines in the top part.
The user should be able then to create adjustments in the lower section of the screen (screenshot attached) - (and then later posts them by click on the post button).
On my BillingsCycles entity, adjustment is an attribute of type ASSOCIATION, and the data source of my adjustments table is a nested adjustments datasource.
I am facing 2 issues mainly (the first one is solved I guess):
- When the user saves a new adjustment, nothing is committed to the database. I think this is due to the header-detail architecture. So the detail is not saved unless the header is saved. However, in my case, the header “BillingCycles” has not changed, so the system is not able to save the adjustment. To overcome this issue, I have programmatically saved the record by calling a service bean when the user clicks on Save. Is this the proper way of handling it?
- As you can see in the attached snapshot, I am not able to display descriptions in the adjustment table, only IDs. This is because I cannot choose any view for the nested datasource. I had to put all fields for the adjustments entity in its instance, so that I can use them in the nested datasource of my adjustments table.
How can I overcome this limitation?
I have attached the code for the pending invoice and adjustment editor screens.
Thank you for your usual help.