Accounts
[% FOREACH cl IN credit_list; IF cl.entity_class == 1; cl.account_class_title = text('Vendor'); cl.account_class_label = text('Vendor'); ELSIF cl.entity_class == 2; cl.account_class_title = text('Customer'); cl.account_class_label = text('Customer'); END; cl.meta_number_href_suffix = 'account_class=' _ cl.entity_class _ '&entity_id=' _ cl.entity_id _ '&meta_number=' _ cl.meta_number _ '&target_div=credit_div'; END; PROCESS dynatable attributes = {id = 'credit_accounts_list' } columns = [ { col_id = 'account_class_label', type = 'text', name = text('Type') } { col_id = 'meta_number', type = 'href', name = text("Number"), href_base = "$request.script?__action=get&" } { col_id = 'description', type = 'text', name = text("Description") } { col_id = 'creditlimit', type = 'text', name = text('Credit Limit') } { col_id = 'startdate', type = 'text', name = text('Start Date') } { col_id = 'enddate', type = 'text', name = text('End Date') } ], #' tbody = {rows = credit_list}; %] [% PROCESS input element_data = { type = "hidden" name = "form_id" value = form_id } %] [% PROCESS input element_data = { type = "hidden" name = "entity_id" value = entity_id } %] [% PROCESS input element_data = { type = "hidden" name = "id" value = credit_act.id } %] [% ec = credit_act.entity_class; IF !ec; ec=account_class; IF !ec; ec=entity_class; IF !ec; ec=2; END; END; END; %]

[% PROCESS select element_data = { id = 'eca-entity-class-id' name = 'entity_class' name = "entity_class" options = eca_classes default_values = [ec] text_attr = 'class' value_attr = 'id' label = text('Class') } %] | [% INCLUDE button element_data = { text = text('Update') class="submit" type="submit" name="__action" value="update_credit" }; %]
[% PROCESS input element_data = { title = text("Number"), label = text("Number"), type= "text", name = "meta_number", value = credit_act.meta_number, size = "10" } %] | [% PROCESS input element_data = { title = text("Description"), label = text("Description"), type= "text", name = "description", value = credit_act.description, size = "20" } %]
[% PROCESS input element_data = { title = text('Pay To') label = text('Pay To') type = "text" size = "50" name = "pay_to_name" value = credit_act.pay_to_name class = "name" } %]
[% PROCESS input element_data = { title = text('Starting Date'), label = text('Starting Date'), name = "startdate", class = "date", value = credit_act.startdate, type = "text", size = "12", maxlength = "10" } #' %] | [% PROCESS input element_data = { title = text('End Date'), label = text('End Date'), name = "enddate", class = "date", value = credit_act.enddate, type = "text", size = "12", maxlength = "10" } #' %]
[% INCLUDE input element_data = { name = "threshold" value = credit_act.threshold type = "text" size = "20" title = text('Threshold') label = text('Threshold') class = "numeric" } %] | [% INCLUDE input element_data = { title = text('Credit Limit'), label = text('Credit Limit'), name = "creditlimit", value = credit_act.creditlimit, type = "text", size = "20" } #' %]
[% INCLUDE input element_data = { title = text('Payment Terms'), label = text('Payment Terms'), name = "terms", value = credit_act.terms, type = "text", size = "5" } %] [% text('days') %] | [% INCLUDE input element_data = { title = text('Discount'), label = text('Discount'), name = "discount", value = credit_act.discount, type = "text", size = "3", maxlength = 3 } %]% / [% INCLUDE input element_data = { name = "discount_terms", value = credit_act.discount_terms, type = "text", size = "3", maxlength = 3 } %] [% text('days') %] | [% INCLUDE select element_data = { name = "discount_account_id" default_values = [credit_act.discount_account_id] options = discount_acc_list title = text('Account') label = text('Account') text_attr = "text" value_attr = "id" } %]
[% INCLUDE select element_data = { name = "ar_ap_account_id" default_values = [credit_act.ar_ap_account_id] options = ar_ap_acc_list title = (ec == 1) ? text('AP') : text('AR') label = (ec == 1) ? text('AP') : text('AR') text_attr = "text" value_attr = "id" } %] | [% INCLUDE select element_data = { name = "cash_account_id" default_values = [credit_act.cash_account_id] options = cash_acc_list title = text('Payment') label = text('Payment') text_attr = "text" value_attr = "id" } %] | [% INCLUDE select element_data = { name = 'curr' options = all_currencies text_attr = 'curr' value_attr = 'curr' default_values = [credit_act.curr] title = text('Currency') label = text('Currency') } %]
[% IF business_types.size %] [% INCLUDE select element_data = { name = "business_id" options = business_types default_values = [credit_act.business_id] text_attr = "description" value_attr = "id" title = text('Business Type') #' label = text('Business Type') #' default_blank = 1 } %] [% END %] | [% IF pricegroups.size %] [% INCLUDE select element_data = { default_values = [credit_act.pricegroup_id], name = 'pricegroup_id' options = pricegroups title = text('Pricegroup') label = text('Pricegroup') value_attr = 'id' text_attr = 'pricegroup' default_blank = 1 } %] [% END %]
[% IF taxform_list.size %] [% INCLUDE select element_data = { name = "taxform_id" options = taxform_list default_values = [credit_act.taxform_id] text_attr = "form_name" value_attr = "id" title = text('Tax Form') #' label = text('Tax Form') #' default_blank = 1 } %] [% END %] | [% IF NOT credit_act.language_code; credit_act.language_code = default_language; END; INCLUDE select_language element_data = { title = text("Language") label = text("Language") name = "language_code" default_values = [credit_act.language_code], default_blank = 1, options = language_code_list text_attr = "text" value_attr = "code" } %]

[% text('Taxes') %]
[% FOR tx = all_taxes %]
[% checked = ""; IF credit_act.tax_ids.grep("^${tx.id}\$").size == 1; checked = "CHECKED"; END; INCLUDE input label_pos=1 element_data = { title = tx.accno _ '--' _ tx.description label = tx.accno _ '--' _ tx.description type = "checkbox" checked = checked name = "taxact_$tx.id" value = tx.id } %]
[% END # FOR tx %]
[% checked = ''; IF credit_act.taxincluded; checked='CHECKED'; END; INCLUDE input label_pos=1 element_data = { title = text('Tax Included') #' label = text('Tax Included') #' type = "checkbox" checked = checked name = "taxincluded" value = '1' } %]
[% IF credit_act.id; INCLUDE button element_data = { text = text('Save Changes'), #' class="submit" type="submit" name="__action" value="save_credit" }; END; INCLUDE button element_data = { text = text('Save New'), #' class="submit" type="submit" name="__action" value="save_credit_new" title="Save Credit Account as New" }; IF credit_act.id; IF (entity_class == 1); %]
[% ELSE %]
[% END %]
[% END %]
[% IF credit_act.id %]
[% text('Profit and Loss') %]
[% PROCESS input element_data = { type = "hidden" name = "id" value = credit_act.id }; %]
[% text('Period selection') %]
[% text('Select using') %]
[% IF comparison_type == 'by_periods'; YES="CHECKED"; NO=undef; ELSE; NO="CHECKED"; YES=undef; END; -%]
[% PROCESS input element_data={ type = 'radio', name = 'comparison_type', id = 'comparison_by_dates', value = 'by_dates', label = text('Dates'), checked = NO } label_pos = 1 ; %]
[% PROCESS input element_data={ type = 'radio', name = 'comparison_type', id = 'comparison_by_periods', value = 'by_periods', label = text('Periods'), checked = YES, } label_pos = 1 ; %]
[% label_pos = -1; # apparently, there's something leaky PROCESS input element_data = { label=text('From') class="date" name="from_date" id="from_date" size="11" title=datestyle } %]
[% label_pos = -1; # apparently, there's something leaky PROCESS input element_data = { label=text('To') class="date" name="to_date" id="to_date" size="11" title=datestyle } %]
[% PROCESS date_period_div; %]
Report options
[% PROCESS input element_data = { label = text('Account numbers') name = 'incl_accnos' type = 'checkbox' value = 1 checked = 'checked' # checked by default }; %]
[% text('Hierarchy type') %]
[% HIERARCHY_SETUP = earn_id; IF HIERARCHY_SETUP; full_checked = 'CHECKED'; full_disabled = undef; legacy_checked = undef; ELSE; full_disabled = 'DISABLED'; full_checked = undef; legacy_checked = 'CHECKED'; END; %]
[% PROCESS input element_data = { label = text('Full') type = 'radio' name = 'legacy_hierarchy' value = 0 id = 'legacy-hierarchy-0' checked = full_checked disabled = full_disabled } label_pos = 1; %] [% IF full_disabled %] [% text('Not set up for hierarchy reporting, please see linked instructions') %] [% END %]
[% PROCESS input element_data = { label = text('Account category') type = 'radio' name = 'legacy_hierarchy' value = 1 id = 'legacy-hierarchy-1' checked = legacy_checked } label_pos = 1; %]
[% PROCESS button element_data = { text = text('Continue') type = 'submit' class = 'submit' name = '__action' value = 'generate_income_statement' }; %] [% END # IF credit_act.id %]