Debt Age Analysis and Interest payments on Statements

I would like to understand these concepts more clearly. I have Debt Age Analysis under control, but am unsure how to calculate interest.

In this example I have a policy of "Interest at 2% p.a. above prime will be charged 30days after statement" . Make Interest 10%
A screenshot of a worksheet can be found here:

1. 15 June Customer purchases goods for R1000
2. 30 June: Balance = 1000 Debt Age : Current=1000/30DAYS = 0 Interest = 0
3. 15 July : purchase R500
4. 20 July : payment R200
5. 31 July : Balance = R1300 (total purchases 1500 - total payments 200) Debt Age : Current = 500 30DAYS = 800(Note 1), Interest ? (Note 2)

Note 1: The payment of 200 is subtracted from the oldest debt
Note 2: Question: What interest is charged? Is it charged on the whole balance from 15 June to 31 July, or is it charged on R800 from 15 June to 31 July, or is it charged as per Debt age analysis ie 30Days on R800, zero on Current

I am confused, please help
--

Regards
Laurence