X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=templates%2Fwebpages%2Fcsv_import%2Fform.html;h=568324e28bedb3ae652ef1424ed4276d5292edcc;hb=1281896520473a475a2f21006481ac1f5bd4de40;hp=4a9672b8fd1193678856953806e55c761c5309ee;hpb=80983f8a1f49a8f9663f6c6cc39826d856171d2f;p=kivitendo-erp.git diff --git a/templates/webpages/csv_import/form.html b/templates/webpages/csv_import/form.html index 4a9672b8f..568324e28 100644 --- a/templates/webpages/csv_import/form.html +++ b/templates/webpages/csv_import/form.html @@ -2,16 +2,20 @@ [%- USE LxERP %] [%- USE L %] [%- USE T8 %] - -
[% FORM.title %]
+

[% FORM.title %]

[%- INCLUDE 'common/flash.html' %] -
+ [% L.hidden_tag('form_sent', '1') %] [% L.hidden_tag('action', 'CsvImport/dispatch') %] [% L.hidden_tag('profile.type', SELF.profile.type) %] + [% L.hidden_tag('tmp_profile_id', SELF.profile.id) %] + [%- IF SELF.profile.get('dont_edit_profile') %] + [% L.hidden_tag('force_profile', 1) %] + [% L.hidden_tag('profile.id', SELF.profile.id) %] + [%- ELSE %][%# IF SELF.profile.get('dont_edit_profile') %]

[%- LxERP.t8('Import profiles') %]

@@ -20,7 +24,7 @@ - [%- END %] + [%- END %][%# IF SELF.profile.id %] [%- IF SELF.all_profiles.size %] @@ -33,7 +37,7 @@ [% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %] - [%- END %] + [%- END %][%# IF SELF.all_profiles.size %] @@ -62,9 +66,9 @@ [%- FOREACH p = SELF.worker.profile %] - [%- END %] + [%- END %][%# FOREACH SELF.worker.profile %] - + [%- FOREACH p = SELF.worker.profile %] [% SET ri = p.row_ident %] - [%- END %] + [%- END %][%# FOREACH SELF.displayable_columns.$ri %]
[%- LxERP.t8('Current profile') %]: [%- HTML.escape(SELF.profile.name) %]
[%- LxERP.t8('Save settings as') %]:
[%- p.row_ident %]
@@ -79,13 +83,13 @@ [%- HTML.escape(row.name) %] [%- HTML.escape(row.description) %]
- [%- END %] + [%- END %][%# FOREACH SELF.worker.profile %] - [%- ELSE %] + [%- ELSE %][%# IF SELF.worker.is_multiplexed %] @@ -97,27 +101,22 @@ - [%- END %] + [%- END %][%# FOREACH SELF.displayable_columns %]
[%- LxERP.t8('Column name') %][%- HTML.escape(row.name) %] [%- HTML.escape(row.description) %]
- [%- END %] + [%- END %][%# SELF.worker.is_multiplexed %] [%- IF SELF.type == 'contacts' %]

[%- LxERP.t8("You can update existing contacts by providing the 'cp_id' column with their database IDs. Otherwise: ") %] - [%- 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') %] + [%- LxERP.t8('At least one of the columns #1, customer, customernumber, customer_gln, vendor, vendornumber, vendor_gln (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') %] + [%- LxERP.t8('At least one of the columns #1, customer, customernumber, customer_gln, vendor, vendornumber, vendor_gln (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'.") %] -

-

[1]: [% LxERP.t8('The three columns "make_X", "model_X" and "lastcost_X" with the same number "X" are used to import vendor part numbers and vendor prices.') %] @@ -129,23 +128,38 @@ [2]: [% LxERP.t8('Onhand only sets the quantity in master data, not in inventory. This is only a legacy info field and will be overwritten as soon as a inventory transfer happens.') %]

- -[%- ELSIF SELF.type == 'orders' %]

- [1]: - [% LxERP.t8('The column "datatype" must be present and must be the first column. The values must be the row names (see settings) for order and item data respectively.') %] + [3]: + [% LxERP.t8("If the article type is set to 'mixed' then a column called 'part_type' or called 'pclass' must be present.") %] + [% LxERP.t8("Type can be either 'part', 'service' or 'assembly'.") %] + [%- LxERP.t8("If column 'pclass' is present the article type is then irrelevant or used as default ") %] + [% LxERP.t8("The 'pclass' column has the same abbreviation like a part export. The first letter is for the type Part,Assembly or Service, the second(and third) for Part Classification") %]

+ +[%- ELSIF SELF.type == 'inventories' %]

- [2]: - [%- LxERP.t8('Amount and net amount are calculated by kivitendo. "verify_amount" and "verify_netamount" can be used for sanity checks.') %]
- [%- LxERP.t8('If amounts differ more than "Maximal amount difference" (see settings), this item is marked as invalid.') %]
+ [%- LxERP.t8('One of the columns "qty" or "target_qty" must be given. If "target_qty" is given, the quantity to transfer for each transfer will be calculate, so that the quantity for this part, warehouse and bin will result in the given "target_qty" after each transfer.') %]

-[%- END %] +[%- ELSIF SELF.type == 'orders' OR SELF.type == 'delivery_orders' OR SELF.type == 'ar_transactions' %]

- [%- L.submit_tag('action_download_sample', LxERP.t8('Download sample file')) %] + [1]: + [% LxERP.t8('The column "datatype" must be present and must be at the same position / column in each data set. The values must be the row names (see settings) for order and item data respectively.') %]

+ [%- IF SELF.type == 'orders' OR SELF.type == 'ar_transactions' %] +

+ [2]: + [%- LxERP.t8('Amount and net amount are calculated by kivitendo. "verify_amount" and "verify_netamount" can be used for sanity checks.') %]
+ [%- LxERP.t8('If amounts differ more than "Maximal amount difference" (see settings), this item is marked as invalid.') %]
+

+ [%- END %] +[%- END %][%# IF SELF.type == … %] + +
+

+ [%- L.submit_tag('action_download_sample', LxERP.t8('Download sample file')) %] +


@@ -163,7 +177,14 @@ [%- 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') %] + [% L.select_tag('settings.numberformat', ['1.000,00', '1000,00', '1,000.00', '1000.00', "1'000.00"], default = SELF.profile.get('numberformat'), style = 'width: 300px') %] + + + + + [%- LxERP.t8('Date Format') %]: + + [% L.select_tag('settings.dateformat', ['dd.mm.yyyy', 'yyyy-mm-dd', 'dd/mm/yyyy', 'mm/dd/yyyy' ], default = SELF.profile.get('dateformat'), style = 'width: 300px') %] @@ -180,7 +201,7 @@ [% 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 %] + [%- END %][%# FOREACH SELF.all_sep_chars %] [% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %] @@ -196,7 +217,7 @@ [% 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 %] + [%- END %][%# FOREACH SELF.all_quote_chars %] [% L.radio_button_tag('quote_char', value => 'custom', checked => custom_quote_char != '') %] @@ -212,7 +233,7 @@ [% 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 %] + [%- END %][%# FOREACH SELF.all_escape_chars %] [% L.radio_button_tag('escape_char', value => 'custom', checked => custom_escape_char != '') %] @@ -229,7 +250,7 @@ [% FOREACH key = duplicate_fields.keys %] - [% END %] + [% END %][%# FOREACH duplicate_fields.keys %] @@ -243,7 +264,7 @@ [% L.select_tag('settings.duplicates', opts, default = SELF.profile.get('duplicates'), style = 'width: 300px') %] - [% END %] + [% END %][%# IF duplicate_fields.size %] [%- IF SELF.type == 'parts' %] [%- INCLUDE 'csv_import/_form_parts.html' %] @@ -251,16 +272,24 @@ [%- INCLUDE 'csv_import/_form_customers_vendors.html' %] [%- ELSIF SELF.type == 'contacts' %] [%- INCLUDE 'csv_import/_form_contacts.html' %] +[%- ELSIF SELF.type == 'inventories' %] + [%- INCLUDE 'csv_import/_form_inventories.html' %] [%- ELSIF SELF.type == 'orders' %] [%- INCLUDE 'csv_import/_form_orders.html' %] +[%- ELSIF SELF.type == 'delivery_orders' %] + [%- INCLUDE 'csv_import/_form_delivery_orders.html' %] +[%- ELSIF SELF.type == 'ar_transactions' %] + [%- INCLUDE 'csv_import/_form_artransactions.html' %] +[%- ELSIF SELF.type == 'bank_transactions' %] + [%- INCLUDE 'csv_import/_form_banktransactions.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')) %] + [% L.radio_button_tag('settings.full_preview', value=0, checked=!SELF.profile.get('full_preview'), 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 Lines with Notes or Errors')) %] + [% L.radio_button_tag('settings.full_preview', value=2, checked=SELF.profile.get('full_preview')==2, label=LxERP.t8('First 20 Lines')) %] @@ -274,24 +303,52 @@ [%- 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 %] + [%- END %][%# IF SELF.file.exists %]
- [% L.submit_tag('action_test', LxERP.t8('Test and preview')) %] - [% L.submit_tag('action_import', LxERP.t8('Import'), style='display:none') %] +[%- UNLESS SELF.worker.is_multiplexed %] +

[% 'Mappings (csv_import)' | $T8 %]

+ + + +
+[%- END %][%# UNLESS SELF.worker.is_multiplexed %] +[%- END %][%# IF SELF.profile.get('dont_edit_profile') %]
[%- IF SELF.deferred %] [%- PROCESS 'csv_import/_deferred_results.html' %] - [%- ELSIF SELF.import_status %] - [%- PROCESS 'csv_import/_results.html' %] - [%- END %] + [%- END %][%# IF SELF.deferred %]
@@ -303,7 +360,14 @@ return true; alert('[% LxERP.t8('Please enter a profile name.') %]'); return false; - }) + }); + $('#add_empty_mapping_line').click(function(){ + $.get('controller.pl', { action: 'CsvImport/add_empty_mapping_line', 'profile.type': $('#profile_type').val() }, kivi.eval_json_result); + }); + $('#add_mapping_from_upload').click(function(){ + $.get('controller.pl?action_add_mapping_from_upload=1', $('form').serialize() , kivi.eval_json_result); + }); + $('#csv_import_mappings').on('click', '.remove_line', function(){ $(this).closest('tr').remove(); if (1==$('#csv_import_mappings tr:visible').length) $('#mapping_empty').show() }); }); -->