Presumably, this is a layout based on the LineItems table so you can print invoices in the same manner as the Invoices starter solution.
The payment records, I assume, are not records in the LineItems table, but are recorded in a different table.
Given that structure, you'll need to put a portal to the payments table on your layout in a trailing grand summary in order to display payments. You can set up the portal with more rows than you expect to ever need for a given invoice and then use "slide up" and "resize enclosing part" in the Inspector's sliding and visibility section to shrink the portal and trailing grand summary part down to just the number of rows needed for a given invoice. (And if you ever get more payment records than you have rows, the additional rows will not be visible until you change the layout to add more rows to your portal.)
Key facts about sliding layout objects:
- It's only visible in preview mode and when you print/save as PDF...
- All layout objects below and in the same layout part as the slide/resize field need to also be set to slide up and resize.
- Objects in headers and footers will not slide.
- Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
- Container fields will slide only if Top, Left alignment is specified for it in the data formatting section of the Inspector's data tab.
- Consistent side borders are difficult to achieve with sliding fields.
Excellent - that worked a treat.
I placed the payment portal to the left, and an overview of the complete transaction to the right, so the payment portal has nothing below it.