#NEWLINE# def get( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# template_name = 'invoice.html' #NEWLINE# school = School . objects . get ( pk = kwargs [ 'pk' ] ) #NEWLINE# due_date = ( school . registered + datetime . timedelta ( days = 21 ) ) #NEWLINE# delegate_total = sum ( ( school . beginner_delegates , school . intermediate_delegates , school . advanced_delegates ) ) #NEWLINE# delegate_fees = ( delegate_total * School . DELEGATE_FEE ) #NEWLINE# fees_owed = school . fees_owed #NEWLINE# fees_paid = school . fees_paid #NEWLINE# amount_due = ( fees_owed - fees_paid ) #NEWLINE# context = Context ( { #NEWLINE# #INDENT# 'name' : school . name , #NEWLINE# 'date_registered' : school . registered . strftime ( '%m/%d/%y' ) , #NEWLINE# 'due_date' : due_date . strftime ( '%m/%d/%y' ) , #NEWLINE# 'delegate_total' : delegate_total , #NEWLINE# 'delegate_fee' : School . DELEGATE_FEE , #NEWLINE# 'delegate_fees' : delegate_fees , #NEWLINE# 'registration_fee' : School . REGISTRATION_FEE , #NEWLINE# 'fees_owed' : fees_owed , #NEWLINE# 'fees_paid' : fees_paid , #NEWLINE# 'amount_due' : amount_due , #NEWLINE# #UNINDENT# } ) #NEWLINE# return render_to_pdf_response ( request , template_name , context , ** kwargs )