Random error every time viewing and invoice

Suddenly getting this error overtime I try and view an invoice:

Fatal error: Smarty error: [in cache/modules/AOS_Invoices/EditView.tpl line 785]: syntax error: unbalanced parenthesis in if statement (Smarty_Compiler.class.php, line 1268) in /home/younggu0/public_html/crm/include/Smarty/Smarty.class.php on line 1095

Help!

Hi,

Try to do repair and rebuild.

Already tried that

Are your permissions set correctly?

Yeah

I fixed it!
Turned out I had restored a backed up database and it corrupted some custom fields made since the backup.