How have you structured your table?
What you show could be 4 records or just two records.
If it's only one record with multiple fields, we have problems as that will really complicate this process. 4 Separate records is the simplest structure for your reporting, but I can also see where that may require a bit of extra effort in computing the comission payments in the first place.
Are the payment dates always on the 1st and 15th of the month?
Unfortunately it's one record with multiple fields:
Table - Contracts
Fields used: JOBID (obviously), TotalCommission1stDate, TotalCommission1stAmt, TotalCommission2ndDate, TotalCommission2ndAmt, TotalCommission
And the payment dates are not always the 1st and the 15th since we pay weekly. I was just putting them there for an example.
The script I have queries the $DateRange of TotalCommission1stDate and then does a NewRecord/Request and queries the $DateRange of TotalCommission2ndDate.
I just don't know where to go from there since adding a sub-total element in my layout will just total up all the amounts shown which can be from outside the $DateRange.
I'd use a related table for the commission payments so that you have one record for each payment for a given job record.
Jobs::JobID = Commissions::JobID
Then you can set up summary fields in Commissions that compute total payments and these can be used to compute totals for a given month or any range of dates needed.
A portal to Commissions on your Jobs layout can be used to record commission payments by hand. And it's also possible to set up a script such that you enter the contract amount and a date and the script computes the commission payments/dates and logs them in the commissions table at the click of a button.