Given the relationship between Credit to Invoice details to Customers:
Customers::pk_Customers_id = Invoice details::_kf_customer_id
Credit::_kf_invoice_id = Invoice details::PrimaryKey
You have two options for displaying customer data:
1) You can place fields from customers directly on the credit layout.
2) You can define fields in Credit for each customer field and use the Looked up value field option to copy the data from customers to Credit.
Many businesses use Option 2 for invoices and all other such transactions as they want a record of what data was current at the time the transaction was processed rather than the current values of those fields--which may have been updated after the fact. If that sounds like a good idea to you, I suggest setting up such fields in Invoice details and then using those fields from Invoice Details on any layouts based on Quotes, Orders, Invoices or Credit.
For selecting the items to be listed with Credit, there are several options possible. I suggest that you use one of the following two approaches. Both require creating a new CreditLineItems table to list the items and quantities selected for credit.
1) Start with an empty portal to CreditLineItems. Select from a conditional value list or a portal to lines to create a record with the same product ID in the portal.
2) Use a script to duplicate the entire list of Lines items, then use an empty Qty field to select and specify items to be included in the Credit calculations.
The relationships would look like this:
Credit::__pk_Credit Number = CreditLineItems::_kf_Credit Number
CreditLineItems::_kf_product_id = CreditedProducts::kp_product_id
CreditedProucts would be a new occurrence of the Products table. For reporting purposes, it may be useful to use an occurrence of Lines for CreditLineItems so that reports of items sold can include and deduct amounts for items credited.
Thank you for the suggested solutions and advice. I think I will come back to you on this as it seems like quite a tricky solution. I just need to finish my payments layout so will start the credit reports/layouts/tables then..