On your invoices layout, if you put a portal to job_details 2, what do you see? Do you see the records you would expect to see?
The details of your relationship and calculation field don't have any obvious errors that I can see anyway...
When I have a layout based on Jobs with a portal based on Job Details 2 then I see the records.
If I change the layout to be based on invoices then I get blanks.
And that explains why you the calculation is not returning a value. It can't find any related records from which to compute the sum.
You'll need to check the values of the fields that define your relationship to see why you can't match a record in Invoices to a record in Job Details 2.
The field is job_details_id - which links invoices and job_details2. In job_details2 (and job details) it has a value (currently 102). However in invoices it has no value. Can't see why ?? Any thoughts ?
Matching Values don't enter themselves into a field unless you set up the system specifically to do that. That happens when a new record is created in a portal and "allow creation of records..." is enabled for the portal record's table occurrence.
If the record wasn't created via a portal, then that would likely explain why the field is empty.
so how can I resolve this ?
I don't know enough about your database to have an answer.
For existing data, you'll need to find a way to update them with the correct numbers. Replace Field contents is a useful tool for assigning a value to an entire block of records, but you'll have to figure out a way to match up the records even though the field is blank.
For future records, you'll need to figure out a layout design and possibly some auto-enter calculations or a script to keep this from happening in the future.
Here's a basic primer on how to link one record to another by giving both a matching ID number.
Option 1, use a portal to a child table to create the records to the layout's parent record:
First, the parent record should have a field defined as an auto-entered serial number. Other fields/values can be used, but this is the safest, simplest type of field to link one record to another. Then link your two tables in a relationship with "Allow creation of records..." enabled for the child table. Place a portal to the child table on a layout based on the parent table and when you enter data into the bottom blank row of this portal, it will automatically receive a copy of the serial number in that auto-entered serial number field you defined in the parent record. If you don't use such a serial number field, you have to define an auto-enter expression or take other steps in a script to make sure that the parent record's key field has a value before you can create records in the portal that are related to it.
Option 2, Create a new record on a child layout and select the desired parent record from a value list.
There are several variations possible here, but basically, you put the child's key field on the layout and format it with a drop down list that enters the matching ID value from the parent record.