AR Statement documents produced in Softbase are sorting invoices by month then by invoice number, so the
invoices are not in date order under each month. That makes the number of days past due is out of sequence as well.
Please consider an update to the AR Statements module to group by month, then sort by invoice date within each month, then by invoice number (only for when there are multiple invoices on the same date.