[%- IF SELF.profile.id %]
[%- LxERP.t8('Current profile') %]:
[%- HTML.escape(SELF.profile.name) %]
[%- END %]
[%- IF SELF.all_profiles.size %]
[%- LxERP.t8('Existing profiles') %]:
[% L.select_tag('profile.id', SELF.all_profiles, title_key = 'name', default = SELF.profile.id, style = 'width: 300px') %]
[% L.submit_tag('action_new', LxERP.t8('Load profile')) %]
[% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
[%- END %]
[%- LxERP.t8('Save settings as') %]:
[% L.input_tag('profile.name', '', style => 'width: 300px') %]
[% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile')) %]
[% L.submit_tag('action_save', LxERP.t8('Save profile')) %]
[% LxERP.t8("Hide help text") %]
[%- LxERP.t8('Column name') %]
[%- LxERP.t8('Meaning') %]
[%- FOREACH row = SELF.displayable_columns %]
[%- HTML.escape(row.name) %]
[%- HTML.escape(row.description) %]
[%- END %]
[%- IF SELF.type == 'contacts' %]
[%- LxERP.t8('At least one of the columns #1, customer, customernumber, vendor, vendornumber (depending on the target table) is required for matching the entry to an existing customer or vendor.', 'cp_cv_id') %]
[%- ELSIF SELF.type == 'addresses' %]
[%- LxERP.t8('At least one of the columns #1, customer, customernumber, vendor, vendornumber (depending on the target table) is required for matching the entry to an existing customer or vendor.', 'trans_id') %]
[%- ELSIF SELF.type == 'parts' %]
[%- LxERP.t8("If the article type is set to 'mixed' then a column called 'type' must be present.") %]
[% LxERP.t8("Type can be either 'part' or 'service'.") %]
[%- END %]
[%- L.submit_tag('action_download_sample', LxERP.t8('Download sample file')) %]
[%- LxERP.t8('Number Format') %]:
[% L.select_tag('settings.numberformat', ['1.000,00', '1000,00', '1,000.00', '1000.00'], default = SELF.profile.get('numberformat'), style = 'width: 300px') %]
[%- LxERP.t8('Charset') %]:
[% L.select_tag('settings.charset', SELF.all_charsets, default = SELF.profile.get('charset'), style = 'width: 300px') %]
[%- LxERP.t8('Separator') %]:
[% SET custom_sep_char = SELF.sep_char %]
[% FOREACH entry = SELF.all_sep_chars %]
[% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [%- END %]
[% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %]
[%- END %]
[% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %]
[% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %]
[%- LxERP.t8('Quote character') %]:
[% SET custom_quote_char = SELF.quote_char %]
[% FOREACH entry = SELF.all_quote_chars %]
[% IF SELF.quote_char == entry.first %] [% SET custom_quote_char = '' %] [%- END %]
[% L.radio_button_tag('quote_char', value => entry.first, label => entry.last, checked => SELF.quote_char == entry.first) %]
[%- END %]
[% L.radio_button_tag('quote_char', value => 'custom', checked => custom_quote_char != '') %]
[% L.input_tag('custom_quote_char', custom_quote_char, size => 3, maxlength => 1) %]
[%- LxERP.t8('Escape character') %]:
[% SET custom_escape_char = SELF.escape_char %]
[% FOREACH entry = SELF.all_escape_chars %]
[% IF SELF.escape_char == entry.first %] [% SET custom_escape_char = '' %] [%- END %]
[% L.radio_button_tag('escape_char', value => entry.first, label => entry.last, checked => SELF.escape_char == entry.first) %]
[%- END %]
[% L.radio_button_tag('escape_char', value => 'custom', checked => custom_escape_char != '') %]
[% L.input_tag('custom_escape_char', custom_escape_char, size => 3, maxlength => 1) %]
[% duplicate_fields = SELF.worker.get_duplicate_check_fields() %]
[% IF ( duplicate_fields.size ) %]
[%- LxERP.t8('Check for duplicates') %]:
[% FOREACH key = duplicate_fields.keys %]
[% duplicate_fields.$key.label | html %]
[% END %]
[% opts = [ [ 'no_check', LxERP.t8('Do not check for duplicates') ],
[ 'check_csv', LxERP.t8('Discard duplicate entries in CSV file') ],
[ 'check_db', LxERP.t8('Discard entries with duplicates in database or CSV file') ] ] %]
[% L.select_tag('settings.duplicates', opts, default = SELF.profile.get('duplicates'), style = 'width: 300px') %]
[% END %]
[%- IF SELF.type == 'parts' %]
[%- INCLUDE 'csv_import/_form_parts.html' %]
[%- ELSIF SELF.type == 'customers_vendors' %]
[%- INCLUDE 'csv_import/_form_customers_vendors.html' %]
[%- END %]
[%- LxERP.t8('Preview Mode') %]:
[% L.radio_button_tag('settings.full_preview', value=2, checked=SELF.profile.get('full_preview')==2, label=LxERP.t8('Full Preview')) %]
[% L.radio_button_tag('settings.full_preview', value=1, checked=SELF.profile.get('full_preview')==1, label=LxERP.t8('Only Warnings and Errors')) %]
[% L.radio_button_tag('settings.full_preview', value=0, checked=!SELF.profile.get('full_preview'), label=LxERP.t8('First 20 Lines')) %]
[%- LxERP.t8('Import file') %]:
[% L.input_tag('file', '', type => 'file', accept => '*') %]
[%- IF SELF.file.exists %]
[%- LxERP.t8('Existing file on server') %]:
[%- LxERP.t8('Uploaded on #1, size #2 kB', SELF.file.displayable_mtime, LxERP.format_amount(SELF.file.size / 1024, 2)) %]
[%- END %]
[% L.submit_tag('action_test', LxERP.t8('Test and preview')) %]
[% IF (SELF.import_status == 'tested') && SELF.num_importable %]
[% L.submit_tag('action_import', LxERP.t8('Import')) %]
[%- END %]