[% IF (entity_id && entity_class == 1) ; text("Edit Vendor") ; ELSIF (entity_class == 1) ; text("Add Vendor") ; ELSIF (entity_id && entity_class == 2) ; text("Edit Customer") ; ELSE ; text("Add Customer") ; END ; %]
[% PROCESS input element_data = { id = 'company-target-div' type = "hidden" name = "target_div" value = 'company_div' } %] [% PROCESS input element_data = { id = 'company-entity-id' type = "hidden" name = "entity_id" value = entity_id } %] [% PROCESS input element_data = { id = 'company-company-id' type = "hidden" name = "id" value = company.id } %] [% PROCESS input element_data = { id = 'company-form-id' type = "hidden" name = "form_id" value = form_id } %] [% PROCESS input element_data = { id = 'company-account-class' type = "hidden" name = "account_class" value = account_class } %]
[% PROCESS input element_data = { label = '_none_' title = text('Control Code') #' id = 'company-control-code' type = "text" name = "control_code" value = company.control_code size = "20" } %] [% IF !created_as_class; created_as_class = entity_class; END; # IF !created_as_class %]
[% company_entity_class = company.entity_class; IF !company_entity_class; company_entity_class = request.entity_class; END; PROCESS select element_data = { id = 'company-entity-class' name = "entity_class" options = entity_classes default_values = [company_entity_class] text_attr = 'class' value_attr = 'id' title = text('Class') label = '_none_' } %]
[% PROCESS input element_data = { title = text('Name') label = '_none_' type= "text" name = "legal_name" value = company.legal_name size = "20" required = 'true' } %]
[% company_country_id = company.country_id; IF !company_country_id; company_country_id = default_country; END; INCLUDE select_country element_data = { id = 'company-country-id' text_attr = "name" value_attr = "id" default_values = [company_country_id] options = country_list name = "country_id" title = text('Country') label = '_none_' required = 'true' default_blank = 1 } %]
[% INCLUDE input element_data = { label = '_none_' title = text('Tax Number/SSN'), name = "tax_id", value = company.tax_id, type = "text", size = "19" } #' %]
[% IF sic_list.size > 0 %]
[% INCLUDE select element_data = { label = '_none_' title = text('SIC'), name = "sic_code", options = sic_list default_values = [ company.sic_code ], default_blank = 1 class = 'sic' } %]
[% END %]
[% INCLUDE input element_data = { label = '_none_' title = text('Sales Tax ID') #' name = 'sales_tax_id' type = 'text' class = 'taxnumber' size = '19' value = company.sales_tax_id } %]
[% INCLUDE input element_data = { title = text('License Number') #' label = '_none_' name = 'license_number' type = 'text' class = 'taxnumber' size = '19' value = company.license_number } %]

[% PROCESS button element_data = { text = text('Generate Control Code') #' id = 'company-generate-control-code' type = "submit" name = "action" value = "generate_control_code" class = "submit" } %] [% PROCESS button element_data = { id = 'company-action-retrieve' text = text('Retrieve') type = 'submit' name = 'action' value = 'get_by_cc' class = 'submit' } %] [% INCLUDE button element_data = { text = text('Save') id = 'company-action-save' class="submit" type="submit" name="action" value="save_company" accesskey="S" title="Save [Alt-S]" } %]
[% FOREACH n = notes %]
[% n.note %]
[% END %]