Import Customers Cards
The Import Customers Cards wizard reads a text file that holds customers. For each customer it adds a customer card and an account, and it updates existing cards if you ask. The file can come from alameen ERP 10 or from another program. In the wizard you choose the file, the separator, how accounts are created, the update options and the meaning of each column. The program then shows a message with the result and a report of what it added, modified and ignored. For the practical steps see Import customers cards. The file, separator and column steps are close to Import Materials Cards. What differs here is how accounts are created and the customer columns.
Opening the wizard
- From the File tab > Import & Export, in the group named "Import Different Types of Cards Exported from Text Files, whether Exported from alameensoft or Other Programs", click Import Customers Cards. See File tab: Tools and Import & Export.
- The button shows when your licence includes the import and export from files feature and the customer cards feature, and the file is not in multiple-files mode.
- The user needs the Import Customers Cards permission in Users Management, on the Operations page, in the group named after the import and export tool. The page linked above explains what happens when you click the button without it.
The steps of an import from an ordinary file, in order:
- Introduction.
- Import Type: it shows only if the program finds the component that reads encrypted files.
- Select File.
- Accounts Receivable.
- Main account code start: it shows only if you chose that the customer account code is in the file.
- Fields Separator.
- Update customers cards.
- File Fields.
An encrypted file has other steps, described in the last part of this page. You move between steps with Next and Back, and every window is titled Import Customers Cards. In the File Fields step Next is disabled and Start appears. When you click Cancel in any step the program asks: "Do you want to exit out importing customer cards". Choose Yes to leave.
The program remembers on this computer the last file, separator, columns and update option, and shows them next time. It saves them only after you click Start and answer Yes.
Introduction
The page explains that the wizard guides you step by step through importing customers cards and customers accounts from a text file, that the file can come from alameen or from another program and can hold customer names and account codes, and that Next moves forward, Back moves back and Cancel quits. It has no fields.
Import Type
This page shows if the program finds the component that reads encrypted files. Otherwise the wizard goes from the introduction straight to the file step.
The page explains that importing from an ordinary file reads customers from a text file that may hold other customer card fields that you choose in later windows, and that importing from an encrypted file imports the fields without letting you choose them.
| Option | What it does |
|---|---|
| Import from Ordinary File | The default. The wizard follows the ordinary steps on this page. |
| Import from Encrypted File | The wizard reads an encrypted file and has its own steps, described in the encrypted file part. If reading encrypted files cannot start when you click Next, the message "Error in protection key, or protection key not connected properly" appears. |
Select File
You give the path of the text file that holds the account and customer names. The page is the file step of Import Materials Cards: a file name box, a browse button next to it that opens a file picker with the filter Text files (*.txt) or all files, and the last file you imported shown in the box. It differs in this:
- For an encrypted file the picker accepts only
BAK Files(*.bak). - When you click Next the program checks that the file exists. If not, it shows "The file doesn't exist" with the file path under it.
- For an encrypted file the program then opens the file. If it cannot read it, one of "File doesn't exist in specified path.", "Can't decode file" or "Error in reading file" appears.
Accounts Receivable
This page shows for an ordinary file. An account is created for each imported customer, and here you decide how and where.
| Option | What it does | Values and rules |
|---|---|---|
| Account Receivable Code Contained In Imported File | The program takes each customer's account code from the Account Code column of the file, and works out the main account from part of that code. | Selected the first time. The step Main account code start follows. The Main Account box is disabled with this option. |
| Main Account Contained In Imported File | The program reads each customer's main account from the Main Account Code and Main Account Name columns, and creates the main account if it does not find it. | The Main Account box is optional. It names the account under which new main accounts are created. |
| Create Account Cards under the Following Main Account | All customer accounts are created under the account you choose. | You must choose the Main Account, or the message "Main account must be selected" appears. |
| Main Account (account lookup box) | The account under which accounts are created. | Enabled with the second and third options. It accepts an account that is not used. If you pick a used account the message "Used Account" appears and the box is cleared. See Lookup boxes, edit boxes and search windows. |
The program remembers your choice here while it stays open, and not after you close it.
How each option creates the account is in Creating customer accounts.
Main account code start
This page shows if you chose Account Receivable Code Contained In Imported File. The program titles it Accounts Receivable. The main account code is taken from the customer account code: the characters between the start and the end. If the chart of accounts has no account with that code, the program creates one whose name is that code.
| Field | Description | Required | Values and rules |
|---|---|---|---|
| Main Account Code Begins With Digit No | The number of the first character of the customer account code that goes into the main account code. | Yes | A number above zero. The default is 1 the first time, then the last value the program saved. |
| Number of Digits in Main Account Code | How many characters the program takes from that start. | Yes | A number above zero. The default is 1 the first time. |
Example: the customer account code 1212 with start 1 and number 3 gives the main account 121.
If you enter zero or leave a field empty, the message "The end digit number of code must be more than the beginning one" appears. During the import, if the main account is used, the program shows "Used Account" with its code and name, then "Accounts receivables supposed to be sub to this account will not have a main account", then "Do you want to continue?". Choose No to stop the import and undo what it added. The program asks this question only once while it stays open.
Fields Separator
This page is the same as the Fields Separator step of Import Materials Cards: Tab (the default), Comma, Semicolon and Other, with a box in which you type one character. The accounts and budget import wizards use it too. If you choose Other and leave the box empty, the message "You must specify field separator" appears.
Update customers cards
The program titles this page File Fields.
The page explains that if a customer name is repeated, the account card is not added again, and that selecting the first option makes the program modify the repeated customers cards.
| Option | What it does | Values and rules |
|---|---|---|
| Update Customers Cards If Names are Repeated | If the file holds a customer whose name exists in the open company file, the program updates that card with the columns you chose instead of ignoring it. | It starts from the last choice the program saved, and is cleared the first time. |
| Update Customers Cards Depending on Account Code | The program matches customers by account code instead of name, and changes the account name and the customer name to what the file holds. | It shows only if you chose Account Receivable Code Contained In Imported File. It is cleared when the wizard starts. |
You cannot tick both options: while one is ticked, the program does not accept a tick in the other.
If you leave both options cleared, the program ignores every customer whose name exists and does not touch the card. The matching rules are in Matching and updating customers.
File Fields
The page explains that you must specify the fields for the contents of the file: name, code, price and so on, and the line to start importing from, and that accounts will have the same names as the customers.
| Item | Description | Required | Values and rules |
|---|---|---|---|
| Start line | The number of the first customer line in the file, so you can skip a header line. | Yes | A number above zero. The default is 1 every time, and the program does not save it. If the file begins with account lines (see Account lines), they do not count in the start line. |
| Fields grid | The first row holds a list for each column, from which you choose what the column holds. Under it are the first 20 lines of the file split by the separator. The column headers are Column 1 and so on, the row headers Row 1 and so on, and the header of the first row is Fields. | — | Up to 60 columns. The grid shows the file from its first line whatever the Start line, unless the file starts with account lines. |
| Progress bar | Shows while the import runs. | — | — |
Buttons: Start, Back and Cancel.
The first time, column 1 is Customer Name and the other columns are None. After that the program shows the last columns it saved. It restores only the custom fields from the columns that come after Barcode in the list. Those columns are: Field 1 to Field 4, Pay. Terms, Days, Hide in Selection Window, Building No, Floor No, Longitude, Latitude, Tax Registration number, Customer Type, Identifier Type, Identifier Value, Reverse Charge, Person in Charge and District. Choose the ones you need again each time. Column names in the list follow the custom terms of your file if you renamed fields.
Checks when you click Start
The program checks the columns in this order and stops at the first problem:
- Start line is above zero.
- No field is repeated (except None).
- Customer Name is chosen.
- If you chose Days without Pay. Terms, the program stops with no message.
- If you chose Account Receivable Code Contained In Imported File, Account Code must be chosen.
- If you chose Main Account Contained In Imported File, Main Account Code or Main Account Name must be chosen. If you choose both, Main Account Code must be in column 2, or the message "You must specify the field: Main Account Code Payable to Mr Main Account Name" appears.
- With the other two options you may not choose Main Account Code or Main Account Name: the message "You can't select main account code and name in this case" appears.
Then the program asks: "Are you sure to start importing customers cards?" (Yes/No, and No is the default). On Yes the import runs in a single transaction, so everything is saved or everything is undone. You can click Cancel during the import: after you answer Yes to the exit question, the program undoes what it added and modified. The program skips empty lines and reads the file to its end.
File columns
The list of each column offers the choices below, arranged here by topic. Choose None for a column that you do not want to import. The program cleans names and codes it reads: it removes spaces at both ends and tab characters, and shortens repeated spaces. Column names follow the custom terms of your file.
Name and account
| Column | What it does and how it is read |
|---|---|
| Customer Name | The customer name and the name of the account. Required. A line with an empty name does not add a card. It shows in the report as Ignore and "Name is duplicated", or in the list of customers not imported if Update Customers Cards If Names are Repeated is ticked. Remove lines with no name before you import. |
| Account Code | The customer account code. Required with Account Receivable Code Contained In Imported File: if the Account Code cell of a line is empty, the program adds the customer card with no account, and the report shows Add. Fill the code on every line. With Main Account Contained In Imported File: if you choose it the account takes its code from the file, otherwise the program builds the code from the main account code and a serial number. With the third option the program does not read it. |
| Main Account Code and Main Account Name | The customer's main account. Read only with Main Account Contained In Imported File. The program searches by code, and by name if the code is empty. If it does not find the account, it creates it under the account chosen in the step. Its code is the file's code and its name the file's name (or the code if the name is empty). |
| Allocated Budget - Credit and Allocated Budget - Debit | A number. If either is above zero the program sets the customer account's Budget to the difference between them: debit if the debit is larger, credit if the credit is larger. It is written to a new account and, on update, to the existing account. See Account Card. |
| Closing Account Code | Read only with Main Account Contained In Imported File: the account with this code becomes the closing account of the customer account. If it does not exist, or with the other two options, the program uses the first top-level closing account in the chart of accounts. If you choose Pay. Terms, put Closing Account Code in a later column, because the program also reads the Pay. Terms value as the closing account code and takes an account whose code is that number, if one exists. |
| Currency Code | Must match the code of an existing currency, or the account keeps the default currency. The program sets it as the customer account's currency with its exchange rate. |
Card data
| Column | What it does and how it is read |
|---|---|
| Latin name | The customer's Latin name. It is also used as the Latin name of the new account. |
| Prefix, Suffix and Nationality | Text, saved as it is in the customer card. |
| Phone1, Phone2, Fax, Telex, Mobile, Pager, Email, Web Site and Notes | Text, saved as it is in the matching fields. |
| Percentage Discount | A number. |
| Default Price | The price name: Wholesale, Semi wholesale, Retail, Consumer, Export or Distributor, as your file names them. Any other text or an empty cell sets Consumer. Numbers are not accepted. |
| Gender, Certificates, Work and Nature of Work | Text, saved as it is. |
| Date of birth | A date in the order day, month, year, separated by -, / or \. Example: 15-3-1990. |
| Barcode | The customer barcode. If another customer already uses it, the program ignores the line and records it in the list of customers not imported. If you choose this column the program writes the barcode to the card, so an empty cell clears an old barcode. |
| Field 1 to Field 4 | Text, saved as it is in the four matching fields on the Other Fields page. |
| Hide in Selection Window | A number other than zero hides the customer from selection lists. The program sets this field on every card: if you do not choose the column the customer is not hidden, even when you update a card that was hidden. |
| Person in Charge | The name of the person you deal with. |
On every card it adds or updates, the program sets the flag that stops sending text messages, email and WhatsApp. That means the options Send SMS, Send E-mail and Send WhatsApp Message on the Contact page are cleared. See Customer/Supplier Card.
Address
The columns are: Country, City and Region; Country Code, City Code and Region Code; and Street, Details, Post Box, ZIP Code, Building No, Floor No, Longitude, Latitude and District.
- The program creates an address named "Main" for the customer if a region matches, or if the line has Street, Details, Post Box, ZIP Code, Building No, Floor No or coordinates. It becomes the customer's default address if the customer has none. If the line has only Country, City or District and no region matches, no address is created.
- The region is linked if the three names Country, City and Region (none empty) match a region in the chart of addresses. If the three code cells Country Code, City Code and Region Code are all filled, the program uses the codes only: if they match no region, the address has no region even when the names match. The other fields are saved. See Customer Addresses and Chart of Addresses.
- When it updates a customer that has a default address, the program changes that address.
- The program takes the address columns for a customer from the line whose position among the lines read equals the number of customers it added (or updated) before it. That is not the customer's own line. The two are the same line only if the program did not ignore or update (or add) any line before this customer.
Tax and payment terms
| Column | What it does and how it is read |
|---|---|
| Tax Registration number | The customer's tax registration number. |
| Customer Type | 1 or P personal or commercial non-resident, 2 or C commercial, 3 or F legal person (government or outside-kingdom entity). Capital letters as written. The values are in E-Invoice Settings. |
| Identifier Type | The number from 1 to 11 or the identifier code in capital letters: NAT, TIN, IQA, PAS, CR, MOM, MLS, SAG, GCC, OTH and 700. Any other value means none. The full list is in E-Invoice Settings. |
| Identifier Value | The number of the document. |
| Reverse Charge | Fills the Reverse Charge field on the tax page of the customer card. See Customer Tax Pages. |
| Pay. Terms | The number from 0 to 9: 0 cash on delivery, 1 prepaid, 2 due in number of days, 3 due on day of month, 4 due on day of next month, 5 due on day of week, 6 due on day of next week, 7 due at end of month, 8 due at end of one of coming months, 9 credit only. The program accepts the text Cash on delivery for the first one, but treats every other text as the number 0. |
| Days | The number of days that goes with the payment term. It needs Pay. Terms. |
The program saves the payment term and the days on the customer card. If the customer already has a different payment term, the program changes it only with the option Update Customers Cards If Names are Repeated or Update Customers Cards Depending on Account Code. Then it replaces the different terms with those in the file. The program also writes the payment term for an existing customer whose line it ignores, if that customer has no payment term.
Custom fields
At the end of the list come the custom customer fields defined in your file (see Customer/Supplier Card). The value is read as text, a date or a number, according to the type of the field.
Account lines at the start of the file
The file can start with lines that define accounts before the customers. Such a line starts with the text <acc> in its first column, then the account code in the second, then its name, then the code of the main account it belongs to. The program counts these lines from the start of the file up to the first line that does not start with <acc>, and does not count them in Start line. It ignores a line whose account code exists. Otherwise it creates the account under the main account if it finds it, and with no main account if not. It gives the account the first top-level closing account and the default currency of the program. The line shows in the report as code-name.
Creating customer accounts
For each new customer an account is created with the customer's name. Its currency is the default currency of the program unless the file has Currency Code. The rest depends on the option in the step Accounts Receivable.
| Option | The new account code and its main account |
|---|---|
| Create Account Cards under the Following Main Account | The code of the chosen main account followed by a serial number of at least three digits, which starts after the largest number in the codes of the accounts under it. The main account is the chosen one. The program does not read Account Code. |
| Account Receivable Code Contained In Imported File | The code is the Account Code of the file. If the chart of accounts has an account with that code, the program links the customer card to it and creates no account. The main account is the account whose code is taken from the code as in Main account code start. |
| Main Account Contained In Imported File | The code is the Account Code of the file if you chose it, otherwise the main account code followed by a serial number of at least two digits. The main account is the account with the code Main Account Code or the name Main Account Name. If it exists and is used, the program gives the new account no main account. |
The closing account, the currency and the budget limit come from the matching columns, as in File columns. At the end of the import the program adds _Duplicated to the name of every account that is not linked to a customer when another account has the same name under the same main account.
Matching and updating customers
The program matches each line with the customers of the open company file by Customer Name alone, ignoring letter case. Then it decides what to do:
| Case | What the program does | The note in the report |
|---|---|---|
| The name does not exist | Adds a customer card and a new account. | Add |
| The name exists, and Update Customers Cards If Names are Repeated is cleared | Ignores the line and changes nothing. | Ignore and "Name is duplicated" |
| The name exists, and the option is selected | Updates the card with the columns you chose and touches nothing else. | Modify and "Name is duplicated" |
| The name is repeated inside the file | Processes the first line, then ignores the second, or updates the same card if the update option is selected. | As in the cases above |
| Update Customers Cards Depending on Account Code is selected, and the account code belongs to an existing customer | Updates that customer's card, and changes the account name and the customer name to what the file holds. | Modify and an empty note |
| The barcode is used by another customer | Ignores the line and records its name in the list of customers not imported. | Ignore and "Barcode is duplicated" |
| A new card cannot be saved | Records the name in the list of customers not imported. | Ignore and an empty note |
| An existing card cannot be updated | The same. | Ignore and "Name is duplicated" |
| The card to update is not found | Records the name in the list; the line does not appear in the report. | — |
New cards get empty or default values for the fields you did not choose a column for. When it updates, the program writes only the columns you chose: a chosen column whose cell is empty writes an empty value or zero over the current value. The exceptions are the fields the program sets on every card: Hide in Selection Window and the flags that stop sending messages, listed in File columns.
The final message and the list of customers not imported
If the import ends with no customer left out, a message appears: " Importing customers cards has been completed." then "Total of imported customers" followed directly by the number (added plus updated), then "Total cards updated: …" if cards were updated, then "Total cards appended: …" if cards were added.
List of customers not imported
If the program recorded a customer as not imported (a duplicate barcode or a failed save), the message above does not appear. The Customers cards not imported window appears instead.
| Item | Description |
|---|---|
| Customers not imported | A list of customer names. The program adds "_Barcode is duplicated" to the name of a customer whose barcode is duplicated. |
| "Do you want to save imported cards" | The question you answer with one of the two buttons. |
| Ok | The program saves the rest, shows "Customers names not imported are saved in the file:" and the path of a temporary file that holds the names, and then shows the report. |
| Cancel | The program undoes the whole import: nothing is saved and no report appears. |
Imported customers report
After the save, a window appears with the question "Do you want to preview imported information." and the buttons Preview and Close. The title of the window in the program is Imported Allocated Budget Cards, because it is the same window that the budget import uses. Preview opens the report Imported Customers Cards in the report viewer (see Report viewer). The window does not appear if the file had no lines.
The header of the report shows Start Time and End Time, and its table has three columns:
| Column | Description |
|---|---|
| Name | The customer name, or the account code, a hyphen and its name for an <acc> line. |
| Operation | Add, Modify or Ignore. |
| Notes | The reason for ignoring or modifying: "Name is duplicated", "Barcode is duplicated", or "Code already exists" for an <acc> account that exists. |
The right-click menu of a customer row has View Customer Card..., and that of an <acc> account row has View Account Card.... The command shows for a user who has the permission to open the card.
Encrypted file
This import needs the component that reads encrypted files, and the Import Type step does not show without it. The steps after you choose Import from Encrypted File are: the file, then the file information, then the chart of accounts, then the update fields, then the fields step, where Next is disabled and Start appears. The fields step shows no grid and no start line, so you choose no columns. The program imports the customers with their names and barcodes from the records of the file, and builds the city and region accounts if you choose the tree. It adds the new locations and matches an existing one by the location identifier stored in the file. If a customer with the same name exists, the program adds to the name the employee name, then the region, then the city, with a hyphen between the parts, until the name is unique. If that fails it records the customer in the list of customers not imported.
File information
The page explains that it holds information about the encrypted file, such as its creation date and description. All of it is read-only:
| Field | Description |
|---|---|
| File Creation Date: | The date and time of the file. |
| Records Count: | The number of records in the file. |
| File Description: | The description of the file. |
When you click Next the program reads all the records of the file.
Chart of accounts
The page explains that here you select the accounts tree for the customers cards, that the first option creates a tree under the selected account with a city account, then a region account, then the customers accounts, and that the second option creates the customers accounts under the selected account with no city and region accounts.
| Option | What it does | Values and rules |
|---|---|---|
| Create Account Tree For Cities and Regions | The program creates the city and region accounts and then the customers. | Selected by default, and the program remembers your choice while it stays open. The Main Account field is optional with it. |
| Accounts Sub To This Account | The customer accounts are created under the chosen account. | You must choose the Main Account, or "Main account must be selected" appears. |
| Main Account | The account that the accounts belong to. | If you choose it with Accounts Sub To This Account and it is used, the message "Used Account" appears and the field is cleared. |
Update Fields
The page explains that it is for selecting the fields you want to update when barcodes are included in the file, and that you choose them from the list of fields. It is a check list headed Customer fields. Every item is cleared the first time, and then the program saves your choice:
| Item | What it does when selected |
|---|---|
| Customer Name | Changes the name of the existing customer to its name in the file, adding the employee name, region and city if a customer with the same name exists. |
| City, Region and Street | The program does not write their values to the customer card, but selecting any one of them makes the program modify the existing card and record it as modified. |
| Phone1 | Puts the phone of the location in Phone1. |
| Employee in Charge | Puts the name in Field 1. |
| Customer Type | Puts the type of the location in Field 2. |
| Barcode | Puts the barcode in the card. |
If you select any item, the program updates the existing customer cards that have the same identifier. New customers get the name, barcode, phone and Field 1 as they are in the file, and Field 2 (the type) if you selected Customer Type.
Messages
| Message | Why it appears | What to do |
|---|---|---|
| "The file doesn't exist" with the path | There is no file at the path written in the file step. | Correct the path. |
| "File doesn't exist in specified path.", "Can't decode file" or "Error in reading file" | The encrypted file could not be read. | Choose a valid encrypted file. |
| "Error in protection key, or protection key not connected properly" | You chose Import from Encrypted File and reading encrypted files could not start. | Ask the system administrator. |
| "Main account must be selected" | You chose Create Account Cards under the Following Main Account or Accounts Sub To This Account without an account. | Choose the main account. |
| "Used Account" | The chosen main account is used. | Choose an account that is not used. |
| "The end digit number of code must be more than the beginning one" | A zero or empty value in Main Account Code Begins With Digit No or Number of Digits in Main Account Code. | Enter a number above zero. |
| "You must specify field separator" | You chose Other and left the character empty. | Type the separator character. |
| "Start line must be more than zero" | You typed 0 in Start line. | Type 1 or more. |
| "Field duplicated: …" | You chose the same field for two columns. | Choose None for one of them. |
| "You must specify the field: …" | You did not choose Customer Name, Account Code, Main Account Code or Main Account Name where it is needed. | Choose the required field. |
| "You can't select main account code and name in this case" | You chose a main account column with an option other than Main Account Contained In Imported File. | Choose None for the column. |
| "Used Account", then the main account code and name, then "Do you want to continue?" | During the import, the main account derived from the account code is used. | Yes continues with accounts that have no main account. No stops the import and undoes it. |
| "Are you sure to start importing customers cards?" | You clicked Start and the columns are valid. | Choose Yes to start. |
| "Do you want to exit out importing customer cards" | You clicked Cancel. | Choose Yes to leave. |
| "Can't open file:" with a temporary file name | The temporary file could not be created. | Check the space and the write permission of the temporary folder. |
| " Importing customers cards has been completed." and what follows | The import ended. | Check the numbers and open the report if needed. |
Related
This page applies to alameen ERP 10, version 10.1.79.764.