[% IF check.unapproved_transactions
%]
[% END; IF check.unapproved_reports
%]
[% END %]
[% IF ! defined(b_cleared_table);
b_cleared_table = 'checked';
END %]
[% IF ! defined(b_cleared_table) or ! defined(b_cleared_table);
b_mismatch_table = "";
b_outstanding_table = "";
IF !approved and !submitted;
FOREACH row = report_lines;
IF row.err == 'mismatch';
b_mismatch_table = 'checked';
END;
IF row.cleared != 'checked' and row.err != 'mismatch';
b_outstanding_table = 'checked';
END;
END;
END;
END %]