This could be different depending on which version you are, but the basic formula is:
SubTotal = Invoice Amount + Prepaid Deposits + Cash Deposits + Lines Advance Billing - Taxes - Rounding
So in your example it is basically SubTotal = Cash Deposits
At least on the most recent version you can find this amount in InvcHead.DocDepositCredit, doesn’t look like Prepaid Deposits are kept on InvcHead but rather calculated from other tables.