How to Write Script Report in ERPNext

hi,
please see this link
Report not showing total.