This error is made when working with education domain

When tried to make the Payment Entry from Fees, i got this error
Server Error
UnboundLocalError: local variable ‘voucher_type’ referenced before assignment
when i modified payment entry server script by this,
elif party_type == “Student”: # Add this condition for students
voucher_type = None # Set it to the appropriate voucher type for student fees
i’m having trouble with this error
Server Error
pymysql.err.OperationalError: (1054, “Unknown column ‘student’ in ‘where clause’”)