[%# HTML Snippet, for import only %]
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; END; END; %]
[% PROCESS select element_data = { id = 'eca-entity-class-id' name = 'entity_class' name = "entity_class" options = entity_classes default_values = [ec] text_attr = 'class' value_attr = 'id' title = text('Class') } %] [% PROCESS input element_data = { title = text("$entity_classname Number"), #fixme for i18n label = text("$entity_classname 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.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" } %]
[% IF business_types.size %] [% business_types.unshift({}); 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') #' } %] [% END %] [% IF pricegroups.size %]
[% pricegroups.unshift({}); 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' } %]
[% END %]
[% IF taxform_list.size %] [% taxform_list.unshift({}); 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') #' } %] [% 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" accesskey="C" title="Save Credit Account[Alt-C]" }; 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; INCLUDE button element_data = { class="submit" type="submit" name="action" value="add_transaction" accesskey="A" title="Transaction [Alt-A]" text = (entity_class == 1) ? text('AP Transaction') : text('AR Transaction') }; INCLUDE button element_data = { class="submit" type="submit" name="action" value="add_invoice" accesskey="I" title="Invoice [Alt-I]" text = (entity_class == 1) ? text('Vendor Invoice') : text('Customer Invoice') }; INCLUDE button element_data = { class="submit" type="submit" name="action" value="add_order" accesskey="O" title="Order [Alt-O]" text = (entity_class == 1) ? text('Purchase Order') : text('Sales Order') }; INCLUDE button element_data = { class="submit" type="submit" name="action" value="rfq" accesskey="Q" title="Quotation [Alt-Q]" text = (entity_class == 1) ? text('RFQ') : text('Quotation') }; %] [% text('Pricelist') %] [% END %]
[% IF credit_act.id %]
[% text('Profit and Loss') %]
[% PROCESS 'report_base.html'; PROCESS input element_data = { type = "hidden" name = "id" value = credit_act.id }; PROCESS input element_data = { type = "hidden" name = "pnl_type" value = "eca" }; PROCESS date_row_div; PROCESS button element_data = { text = text('Continue') type = 'submit' class = 'submit' name = 'action' value = 'generate_income_statement' }; %]
[% END # IF credit_act.id %]