[% PROCESS elements.html; PROCESS attachments.html; %]

[% form.title %]
[% text('Reference') %] | [% INCLUDE input element_data = { name = "reference", value = form.reference, type = "text", size = "20", class = 'reference' id = "reference" }; IF form.sequences; PROCESS select element_data = { name = 'setting_sequence' default_values = [form.setting_sequence] options = form.sequences text_attr = 'label' value_attr = 'label' default_blank = 1 }; END; %] | [% text('Date') %] | [% INCLUDE input element_data = { name = "transdate" id = "transdate" value = form.transdate size = "11" type = 'text' class = 'date' "data-dojo-props" = "defaultIsToday:true" } %]
[% text('Description') %] | [% IF form.colrowdesc ==1 %] [% INCLUDE textarea element_data={ name = "description" rows = form.rowsdesc cols = form.colsdesc text = form.description id = "des_1" } %] [% ELSE %] [% INCLUDE textarea element_data = { name = "description", text = form.description, type = "text", size = "50", class = 'description' id = "des_1" } %] [% END %]
[% text('Notes') %] | [% IF form.colrownotes ==1 %] [% INCLUDE textarea element_data={ name = "notes" rows = form.rowsnotes cols = form.colsnotes text = form.notes id = "not_1" } %] [% ELSE %] [% INCLUDE textarea element_data = { name = "notes", value = form.notes, size = "50", class = 'notes' id = "not_1" } %] [% END %]
[% text('FX') %] | [% PROCESS input element_data = { name="fx_transaction" type='checkbox' class='fx_checkbox' "data-dojo-type"="lsmb/journal/fx_checkbox" value=1 checked=form.fx_transaction } %]
| [% IF form.reversed_by ; text('This transaction has been reversed by transaction [_1] with ID [_2]', form.reversed_by_reference, form.reversed_by); END %] [% IF form.reversing ; IF form.approved ; text('This transaction reverses transaction [_1] with ID [_2]', form.reversing_reference, form.reversing); ELSE ; text('This transaction will reverse transaction [_1] with ID [_2]', form.reversing_reference, form.reversing); END ; END %] [% text('Status:') %] [% form.status %]
[% text('Account') %] | [% text('FX') %] | [% text('Debit') %] | [% text('Credit') %] | [% text('Source') %] | [% text('Memo') %] [% FOREACH cls IN form.bu_class %] [% IF form.b_units.${cls.id} %] | [% maketext(cls.label) %] [% END %] [% END %]
--- | --- | --- | --- | --- | --- | ---
[% curr = []; FOREACH c IN form.currencies; curr.push({ text = c, value = c }); END; FOREACH displayrow IN displayrows %]
[% INDEX=displayrow.index %] [% IF displayrow.accnoset == 0 %] [% PROCESS input element_data = { name = "accno_$INDEX" type = "text" initial_value = ${"accno_$INDEX"} value = ${"accno_$INDEX"} text_attr = 'accno' value_attr = 'id' class = 'AccountBox' readonly = (form.approved || form.reversing) 'data-dojo-type' = 'lsmb/accounts/AccountSelector' 'data-dojo-props' = 'required: false' } %] [% ELSE %] [% PROCESS label element_data = { text = displayrow.accno align = 'right' id = "acc_$INDEX" } %] [% END %] | [% form.currencies.0 %] | [% PROCESS input element_data = { value = displayrow.debit name = "debit_$INDEX" type = "text" readonly = (form.approved || form.reversing) size = 12 id = "deb_$INDEX" } %] | [% PROCESS input element_data = { value = displayrow.credit name = "credit_$INDEX" type = "text" readonly = (form.approved || form.reversing) size = 12 id = "cre_$INDEX" } %] | [% PROCESS input element_data = { value = displayrow.source name = "source_$INDEX" type = "text" readonly = (form.approved || form.reversing) size = 10 id = "sou_$INDEX" } %] | [% PROCESS textarea element_data = { value = displayrow.memo name = "memo_$INDEX" readonly = (form.approved || form.reversing) size = 30 id = "mem_$INDEX" } %] [% FOREACH cls IN form.bu_class %] [% IF form.b_units.${cls.id} %] | [% clsid = cls.id; bucid = "b_unit_$clsid"; burow = "${bucid}_$INDEX"; INCLUDE select element_data = { text_attr = "control_code" value_attr = "id" readonly = (form.approved || form.reversing) default_values = [displayrow.${bucid}] default_blank = 1 name = "$burow" options = form.b_units.${clsid} } %] [% END %] [% END %]
| [% PROCESS select element_data = { options = curr name = "curr_$INDEX" default_values = [displayrow.curr] readonly = (form.approved || form.reversing) } %] | [% PROCESS input element_data = { value = displayrow.debit_fx name = "debit_fx_$INDEX" type = "text" readonly = (form.approved || form.reversing) size = 12 id = "deb_fx_$INDEX" } %] | [% PROCESS input element_data = { value = displayrow.credit_fx name = "credit_fx_$INDEX" type = "text" readonly = (form.approved || form.reversing) size = 12 id = "cre_fx_$INDEX" } %]
[% END %]
|  | [% form.totaldebit %] | [% form.totalcredit %] |  | [% FOREACH cls IN form.bu_class %] [% IF form.b_units.${cls.id} %] | [% END %] [% END %]

[% FOREACH hidden IN hiddens.keys; PROCESS input element_data={ type => 'hidden', name => hidden, value => hiddens.item(hidden) }; END %] [% FOREACH button IN buttons; PROCESS button element_data=button; END %] [% IF form.id; # Media set with 'screen' value as hidden since UI doesn't have media selector # and lsmb/PrintButton need media value PROCESS input element_data = { type = "hidden" name = "media" value = "screen" }; END; %] [% IF form.recurringset ==1 %] [% PROCESS label element_data = { text => text('Scheduled') align => 'right' } %] [% END %] [% IF form.id; PROCESS attachments attachments = { ref_key = form.id file_class = 1 files = form.files file_links = form.file_links callback = 'gl.pl?__action=edit&id=' _ form.id }; END # IF %]