The wizard works as a single web-page. There is complex JS control on it which changes it's presentation according to current wizard step. There are no page reloads while going back and force through the wizard steps. All interaction with back-end is performed via Ajax calls. The wizard is called from 2 places: Edit Tariff page and Rates page (from toolbar button). After it's finished user is redirected to Rates page.
One of current upload process changes is that now tariff parameters (offpeak, currency etc.) cannot be uploaded. Only rate data can be uploaded.
Wizard component is quite complex so it needs some time to load. Animated icon is displayed during loading process. Each page of wizard (except the first and the last ones) has "Back" and "Next" buttons. If user goes back all data processing will be performed again when "Next" button is pressed.
Step 1 - File Upload
There is nothing special on this page - it's just page with options and file upload control.
Options:
- Add rates from the file to the existing rates
- Replace all of the existing rates with the rates from the file
Radio options to switch between "add" and "replace" mode. If the second option is selected all current rates which are not present in new dataset will be discontinued in case if no errors occurred while importing new rates. Otherwise corresponding message will be reported.(TT#108890) - Rates with 'effective from' date in the past should be uploaded as effective immediately
Allows to use files with outdated 'effective from' field. - Skip rates with the same data
If this option is checked rates from uploaded file which are identical to existing ones will be omitted. This option allows preventing database loading with unchanged data. - Template select - contains list of upload templates.
There are 2 types of upload templates in the list - 'old-style' created template designer and 'new templates' created by upload wizard. If 'old-style' template is selected wizard performs import operation (grabs media parameters, data fields document orders, formats and ports-processing rules). New options values (described below) are populated with default values. After successful import template changes it's type to 'Tariff Upload Wizard'. - Save as template - allow to save a new template. (for >= mr46)
If user chose 'Create New Template' in "Template select" and filled this field with a name wizard current config will be stored under this name and automatically assigned to tariff.
If user chose 'Create New Template' in "Template select" and didn't fill this field current wizard config will be lost after upload.
If user choose some template in "Template select" and set the name new template will be created.
If template name entered by the user already exists in system user will be shown error message.
Templates created by upload wizard are shown in Templates page with special type 'Tariff Upload Wizard'. These templates cannot be edited from that page but can be deleted if not assigned to any tariff. - Timezone select - allows to set timezone for uploaded dates.
Affects only 'effective from' field. If there is an upload template assigned to the tariff select is populated with timezone stored with it. - Send notification to - allows user to set up a comma separated list of emails which will get notification email about new rates. (for >= mr46)
Email contains statistics and information about uploaded rates in attached csv file. File has following columns:
"Destination","Country","Description","First Price","Change","Next Price","Change","Off-Peak First Price","Change","Off-Peak Next Price","Change","Status"
'Change' columns show absolute difference between new values and previous.
'Status' column can be 'new rate', 'increase', 'decrease'. Increase/decrease is determined by price_n.
When user clicks "Next" button wizard performs validation if user selected a file. If success file is uploaded to server and new 'tariff upload session' is started. Session obtains unique session id which is used during all interactions between wizard and server.
While uploading the file and file preprocessing progress indicator is shown to the user. All page interface becomes inactive (unclickable and colored gray) to prevent clicking on it during the process.
Wizard can handle 2 types of files: csv and xls. In order to distinguish file types selected file should have proper extension (.cvs or .xls /i ).
If the file has incorrect format or has no data corresponding error message is shown to the user. Otherwise wizard goes to the next page.
All data is stored in temporary table named 'Rate_Data_'+ upload_session_id.
Step 2 - Review File Parsing
At this step the wizard should determine column delimiter, qualifier, data start row, delimiter for multiple destinations (described below) and document sheet in case of Excel file. If Excel file uploaded only "Row data start", "Delimiter for multiple destinations" and "Sheet" options are shown. In case of CSV there are also "Delimiter" and "Text qualifier" options, "Sheet" option is hidden. Data from only one document sheet can be imported by the wizard.
On this step the wizard operates in a following way:
- Backend tries to determine 3 parameters (delimiter, qualifier, start row).
- WI shows datagrid with parsed data. Columns are filled according to determined parameters. Datagrid shows 20 first rows from the file. In addition there are "show more/less rows" links which add/remove 5 rows if any.
- If something has been determined in a wrong way the user can choose another options' value. In this case changes are applied at once on the WI so the user can see how different option values affect the dataset. Actual rate data are colored light-blue and changing start row value will change the start of the colored region.
The wizard can handle several destinations in a single row. Destinations can be listed in a row separated by delimiter for multiple destinations and also there can be defined destinations range in form "min-max". These two method can be mixed e.g. string "1,2,3,4-10,11,12" is accepted by the wizard.
After successful option values entry the wizard goes to the next step.
Step 3 - Review Data Fields Definition
At this stage data columns should be defined.
Pre-parsing process can take some time so progress indicator is shown to the user. In case of going to previous step and changing some options the data in temporary table is re-parsed.
At first backend tries to recognize minimal set of columns to proceed: destination, description, price_1, price_n, interval_1, interval_n, op_interval_1, op_interval_n, op_price_1, op_price_n (if tariff has off-peak period defined), special_price_1, special_price_n (if tariff has second off-peak period defined). There is general field 'price' which is automatically assigned to the first matching price column. If no other price column is found the rest of prices are linked with this field.
Column options will be described below.
In the top-right corner there is available data fields box. The set of fields is determined by tariff type, there are 4 variants of set: normal, off-peak, routing, routing off-peak. Field names and properties are taken from 4 hidden templates (i_template_type=11). So we can easily add/remove fields to all templates.
Names can be dragged and dropped to dataset column header. If a field is assigned to a column it's name in list is colored light-blue and column header shows light-blue callout with the name of the field. Callout is draggable so user can drag-and-drop it on another column. If callout is dropped in a wrong region (anywhere on page but the column header) the field becomes unassigned.
In the bottom right corner there is data field property box. If user selects a datafield in the list it's properties are shown in properties box where user can change them and it's name becomes colored gray.
Properties:
Format - introduces input data format. Formats are the same as in current template editor.
Postprocessing rule - the same as in current template logic.
Default value - value to be assigned to data field if there is no data for it in the input file.
Apply default value - select box with options "Only if there is no existing rate"/"Always" - defines the way how the default value will be applied. Default is "Only if there is no existing rate". If the second option is selected missing values will be reused from existing rates.
Link with - select box with list of assigned data fields . Allows to set data field value equal to some other field's value.
There are 2 ways of rate upload: by destination and by destination group. The second one is only available if destination group set is defined for the tariff. In this case "Destination Group" field is available. Either "Destination" or "Destination Group" can be present in datafields configuration at the same time. If user tries to use both options he is shown a warning message.
While uploading by destination group a single row in file represents all destinations contained in a set (e.g. if we have destination group named "Set 1" which contains destinations '11','22','33' and a row in file contains this groups all the 3 destinations will be uploaded with corresponding prices, intervals etc. which are defined in the row).
Country Prefix
While uploading by "Destination" and presence of the column "Country Prefix", the value of the "Country Prefix" is joined to each destination value of the uploading row.
Step 4 - Review Rate Information
At this step all data is parsed according to the rules defined at step 3 and stored in the same temporary table. Then user can see all parsed data rows and change prices, intervals, preferences and (off-)peak routing categories.
In case of upload by destination data grid shows the following columns:
- destination
- country + description
- status - shows the way how the price(s) has changed. If status is empty - prices are the same. Otherwise there are two cases: simple change and complex change. Simple change is when all the prices have changed by the same value. In this case status column shows up or down arrow + absolute and relative price change in percents. Complex change is when prices have changed by different values. In this case only up and down arrow is shown in status column.
- price_1
- price_n
- op_price_1 - if tariff has off-peak period defined
- op_price_n - if tariff has off-peak period defined
- special_price_1 - if tariff has second off-peak period defined
- special_price_n - if tariff has second off-peak period defined
- interval_1
- interval_n
- op_interval_1 - if tariff has off-peak period defined
- op_interval_n- if tariff has off-peak period defined
- preference - if tariff has routing enabled
- op_preference - if tariff has routing enabled and has off-peak period defined
- route_category - if tariff has routing enabled and route category column was selected at 3rd step (since mr33-0)
- op_route_category - if tariff has routing enabled, route category and off-peak period columns were selected at 3rd step (since mr33-0)
- effective_from - rate's effective from date (for >= mr46)
- delete icon
Editable columns are prices, intervals. preference and effective from. They have in-place editors.
Price columns are shown in 2 ways: number if the price has not changed and previous value otherwise. In second case price is shown like 'new_price (+/-delta) / old_price'.
(since mr33-0)
Peak and off-peak route category columns have drop-down lists with all route categories provided in system. If category specified in downloaded file exists in system it will be selected by default. If specified category doesn't exist in system it will be replaced with category named "Default". If route category and off-peak period columns were assigned at 3rd step and off-peak route category column wasn't, the off-peak route category column would be shown at 4th step and its value will equal peak route category value.
There are filtering options by prefix, country and description above the data grid.
Also there is a set of English alphabet letters with on-hover popup menus containing country names. This also allows filtering by selection country name. (For =< mr45)
User can provide negative price values for reversed rates. If some row has all prices below zero this rate is marked as reversed and sign of price values is inverted. If some row has negative and positive price values simultaneously this rate is marked as erroneous and this row is colored red. In this case user should edit all such rows and correct errors. If some rows in the document are incorrect the transition to the next step is prohibited and corresponding message is shown to the user. There is a checkbox in the filter panel to show only rates with errors.
In case of upload by destination group data grid shows the following columns:
- destination group
- description
- all fields described above starting from price
For destination group column there are select box containing all groups from template's groups set. If some row contains group name which is not present in the group set it's shown as empty and user can choose another group from the select box. User cannot go to the next step if there are rows with wrong destination group. In this case error message is shown to the user.
In this mode filter control contains buttons to search by destination group and description. Also there is a checkbox to hide rates with already assigned groups which can help user find the rows with wrong groups.
Data grid has pager control.
When delete icon is clicked rate becomes 'deleted' - the whole row is colored gray, in-place editors are disabled, delete icon turns into undelete icon. So the user can revert deletion of the rate.
When user clicks "Next" button new destinations check is performed. If new destinations are present in the uploaded file the wizard goes to step 5, otherwise - to step 6.
Step 5 - Create New Destinations
At this page user can manage new destinations and assign them destination groups and countries.
There is a filter similar to previous step at the top of the data grid. In addition there are filters "Hide destinations with assigned groups" and "Hide destinations with assigned countries" which allow to find rows which has not been processed by user yet.
Data grid show the following columns:
- Selection checkbox
- Destination
- Country
- Destination group(s)
- Delete button
Country column has select with all countries in database. Wizard tries to assign country by prefix, e.g. if there is destination '1' with country=USA in database all new destinations starting with 1 will be assigned USA too. In other hand when user chooses country from selectbox wizard automatically assigns it to all new destinations stating with it.
'Destination Groups' columns show 'plus' button when wizard starts. These columns allow to assign destination to some destination group. If tariff has destination group set assigned clicking 'plus' button at the 'Tariff' column will bring up modal dialog allowing to select destination group from this set. Otherwise first column is hidden. Group selection dialog has 2 search options: by destination group name and prefix. Also it has paging control. 'Other' column shows the same dialog having additional column 'Destination Groups Set'. User can assign only 1 group by using 'Tariff' column and several groups by using 'Other' column. When a group is assigned it's name is shown in the column with 'remove' icon.
Data grid supports multiple rows selection with checkboxes in the first column of the datagrid. Also there is 'select all' checkbox at column header. Multiple selection can be used for assigning destination groups to selected rows by choosing 'Apply to selected' option in popup menu which is automatically shown when cursor is over a row having any groups assigned.
'Apply to selected' option applies both 'Tariff' and 'Other' Destination groups columns to selected rows.
Delete button works similar to previous step.
When clicking 'Next' button wizard checks if all new destinations have countries assigned and shows corresponding error message to user. Otherwise the wizard goes to the next step.
Step 6 - Summary
Summary and confirmation page.
Shows some statistics about uploaded file and control options.
Statistics
Total rates:
New destinations covered:
New destinations created:
Save as template
- If user chose 'Create New Template' at the first step and filled this field with a name wizard current config will be stored under this name and automatically assigned to tariff.
- If user chose 'Create New Template' at the first step and didn't fill this field current wizard config will be lost after upload.
- If user chose some template at the first step this field will contain it's name. If user doesn't change the name all changes will be saved to current template and user will be notified about this. If user changes the name new template will be created.
- If template name entered by the user already exists in system user will be shown error message.
Templates created by upload wizard are shown in Templates page with special type 'Tariff Upload Wizard'. These templates cannot be edited from that page but can be deleted if not assigned to any tariff.
Send notification to
Here user can set up a comma separated list of emails which will get notification email about new rates.
Email contains statistics and information about uploaded rates in attached csv file. File has following columns:
"Destination","Country","Description","First Price","Change","Next Price","Change","Off-Peak First Price","Change","Off-Peak Next Price","Change","Status"
'Change' columns show absolute difference between new values and previous.
'Status' column can be 'new rate', 'increase', 'decrease'. Increase/decrease is determined by price_n.
Notification email also contains the following statistics about upload:
Total rates processed - total count of processed rows.
Old rates overridden - count of existing rates which have been changed during upload.
Total rates created - total count of created rates.
Skipped (due to errors) - count of rows skipped due to errors (format mismatch, effective from in the past etc.).
Skipped (duplicates) - count of row skipped due to duplicate values (if option 'Skip rates with the same data' is on).
New destinations covered - count of rates for new destinations within the tariff.
New destinations created - count of newly created destinations.
When user clicks 'Start Import' button wizard performs validation of template name and starts importing process. It shows progressbar while importing. After import alert about success/failure is shown and browser is redirected to Rates page.
Unknown Destinations
If uploaded rate has destination, which is absent in system it should be created after user clicks 'Start Import'.
If destination was not created, an error 'Destination <destination> does not exist' will be written into log-file and 2 files will be sent with notification letter:
- Destination_Unknown.csv - list of unknown destinations from uploaded file.
- New_destinations.csv - list of unknown destinations in format suitable for upload them into system via Web Interface.