[% PROCESS elements.html; PROCESS report_base.html; BALANCE_TYPES = [ {text = text('Debit'), id = -1} {text = text('Credit'), id = 1} {text = text('Normal'), id = 0} ]; TRIAL_BALANCE_TYPES = [ {text = text('Full'), id = 'sql-ledger' }, {text = text('Ending'), id = 'balance' } ] %]
[% IF report.id; INCLUDE input element_data = { type="hidden", name="report_id", value=report.id }; END;%]

Trial Balance [% id ? 'Edit' : 'Create'%] Report
[% PROCESS business_classes %] [% PROCESS date_row %]
[% PROCESS input element_data = { label = text('All accounts') name = 'all_accounts' type = 'checkbox' value = 1 } %]
[% PROCESS input element_data = { name = 'is_approved' type = 'radio' value = 'Y' label = text('Approved') checked = 'CHECKED' }; %] [% PROCESS input element_data = { name = 'is_approved' type = 'radio' value = 'N' label = text('Unapproved') }; %] [% PROCESS input element_data = { name = 'is_approved' type = 'radio' value = 'All' label = text('All') }; %]
[% text('Balances as') %] | [% PROCESS select element_data = { name = 'balance_sign' id = 'balance_sign' options = BALANCE_TYPES default_values = ['0'] value_attr = 'id' } %]
[% text('Report Type') %] | [% PROCESS select element_data = { name = 'tb_type' options = TRIAL_BALANCE_TYPES value_attr = 'id' } %]

[% # Add in the list of accounts here.%] [% FOR heading IN headings%]
[% heading.accno%] -- [% heading.description%] | [% IF report.heading_id; IF report.heading_id == heading.id; checked="checked"; END; ELSE; checked=undef; END; PROCESS input element_data = { type="radio", name="heading", id="heading-" _ heading.id, value=heading.id, checked=checked }%]
[% FOR account IN heading.accounts%]
[% account.accno%] -- [% account.description%] | [% id = account.id; PROCESS input element_data = { type="checkbox", name="accounts", id="accounts" _ account.id, value=account.id checked=report_accounts.$id }%]
[% END%] [% END%]

[% PROCESS button element_data={ text = text('Continue'), attributes = { name= '__action', value= 'run' } }%]