Skip to main content

Import Materials Cards

The Import Materials Cards wizard reads a text file that holds materials and groups. It adds new cards from it, and updates existing cards if you ask. The file can come from alameen or from another program. In the wizard you choose the file, the separator, the update options and the meaning of each column, and then the program shows a report of what it added, modified and ignored. For the practical steps see Import material cards from a file.

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 Materials Cards. See File tab: Tools and Import/Export.
  • The button shows when your licence includes warehouses and the file is not in multiple-files mode.
  • The user needs the Import Materials Cards permission in Users Management.

The wizard has five steps. You move between them with Next and Back, and every step is titled Import Materials Cards. In the last step Next is replaced by Start. When you click Cancel in any step the program asks: "Are you sure you want to cancel materials cards import?".

Step 1: Introduction​

The page explains that the wizard leads you step by step to import materials and groups cards from a text file, that the file can be produced by alameen or by any other program and can hold material and group codes, names and prices, and that Next moves forward, Back moves back and Cancel quits. It has no fields.

Step 2: Select File​

ItemDescriptionRequiredValues and rules
File name boxThe path of the text file that holds the materials and groups.YesExample: D:\data\materials.txt. The program shows the last file you imported.
Browse button (small square next to the path)Opens a file picker with the filter Text files (*.txt) or all files.—Puts the chosen path in the box.

When you click Next the program checks that the file exists. If not, it shows "The file doesn't exist" with the path.

Step 3: Fields Separator​

ItemDescriptionRequiredValues and rules
TabColumns in the file are separated by the tab character.—The first-time default.
CommaColumns are separated by a comma ,.——
SemicolonColumns are separated by a semicolon ;.——
OtherColumns are separated by another character that you type in the box next to it.—The box is enabled only when this option is chosen. The program uses the first character in it. If it is empty the message "You must specify field separator" appears.

Step 4: Updating Materials Cards​

The page explains that here you choose whether materials with matching codes are updated, and whether their groups are left alone. The options start from the last choice the program saved. The first time, none of them is ticked.

OptionWhat it doesRequiredValues and rules
Update cards for materials with matching codesIf the text file holds a material whose code exists in the open company file, the program updates its card instead of ignoring it.NoIf you leave it unticked, the program ignores every material whose code exists and does not touch its card.
Don't update groups when updating materials cardsThe program does not move an existing material to the group written in the file.NoDisabled until you tick the first option.
Don't update materials names when updating materials cardsThe program keeps the name of an existing material.NoDisabled until you tick the first option.
Just update existing materials' cards informationThe program updates existing materials only, and ignores every material whose code does not exist.NoDisabled until you tick the first option. In the Arabic interface this option is worded "Do not add new materials cards".

Clearing the first option clears the other three.

Step 5: File Fields​

ItemDescriptionRequiredValues and rules
Start lineThe number of the first material line in the file, so you can skip a header line.YesA number greater than zero. The default is 1 every time. Group lines at the top of the file (see Group lines) are not counted.
Fields gridIts first row has a list for each column where you choose what the column holds. Under it are the first 100 lines of the file split by the separator. Column headings are Column 1 and so on, line headings are 1 and so on, and the heading of the first row is Fields.—Up to 100 columns. The grid shows the file from its first line, including any group lines and header line, whatever the start line is. It stays empty if the file is shorter than the start line.
Progress bar and status lineShow the current material number, its name and the time left during the import.——

Buttons: Start, Back and Cancel.

The first time, the list holds six columns: Material Code, Material Name, Group Name, Group Code, and the wholesale and retail prices of the first unit. After that the program keeps the last file, separator, columns and update options on this computer, and saves them when you click Start and then Yes.

Checks when you click Start​

The program checks the columns in this order and stops at the first violation:

  1. Start line is greater than zero.
  2. No field is repeated (except None).
  3. Material Code and Material Name are both present.
  4. Group Name or Group Code is present.
  5. If you chose Force on Input or Force on Output, you must also choose Serial Number.

Then the program asks: "Do you want start importing materials cards" (Yes/No, with No as the default). On Yes the import runs as one transaction, so it is saved completely or cancelled completely. If you used fixed asset columns and one comes before a material column, the message "Asset fields must come after material fields" appears and the import stops. You can click Cancel during the import: the program finishes the current material, then undoes everything it added and modified.

File columns​

Each column list offers the choices below in this order. Choose None for a column you do not want to import. The program cleans the code, name, Latin name, barcode and GPC: it removes spaces at both ends and tab characters, and shortens repeated spaces.

Material and group​

ColumnWhat it does and how it is read
Material CodeThe material code. Required, and the program matches existing materials by it. A line with an empty code is ignored.
Material NameThe material name. Required. A line with an empty name is ignored.
Latin nameThe Latin name.
BarcodeThe first barcode. If it is empty the program does not change the material's barcode. If it has a value the program rebuilds the main barcodes in the extended barcodes table.
SpecificationsThe specifications. If your licence includes pharmacies, the program also saves them as the material's composition.
IndicationsThe indications. It has an effect only if your licence includes pharmacies.
Group NameThe name of the material's group.
Group Latin NameThe Latin name of the group. It is used when a new group is created.
Group CodeThe code of the material's group.
Material TypeStock, Service or Fixed Asset, or the letters م, خ and أ, or st, sr and as, or the numbers 0, 1 and 2. Any other value means a stock material. Choosing a fixed asset needs the fixed assets feature.
First Unit, Second Unit, Third UnitThe unit names.
Conversion Factor of Unit 2, Conversion Factor of Unit 3A number greater than zero, or the text "Variable" for a variable factor. The program does not change the factors of an existing material that has movement in bills.
Second Unit Factor - Variable, Third Unit Factor - VariableThe number 1 makes the factor variable and 0 makes it fixed.
Default UnitThe text "Second Unit" or "Third Unit", or the number 2 or 3. Any other value means the first unit.

Prices and currency​

Each price has three columns in the list, one per unit, and the name of the unit follows the price name, such as "Retail Second Unit". The prices are: Last Purchase, Wholesale, Semi wholesale, Export, Distributor, Retail and Consumer.

Price rules:

  • The value is zero or more. The program ignores a negative value and leaves the price unchanged.
  • The program saves a second or third unit price only if the material has a name for that unit and a non-zero conversion factor, in the file or already on its card.
  • Currency Code must match the code of an existing currency, otherwise the program leaves the currency unchanged. If you did not choose a Parity column the program takes the currency's own parity.
  • Parity is the currency parity number.
  • If the file has a price column, the program multiplies its value by the currency parity before saving, so a price of 10 in a currency with parity 3.75 is saved as 37.50. For prices that are not in the file, the program rescales them by the new parity divided by the old one, so the real price does not change when you change the currency of a material.
  • Price Policy is the exact text Actual, Maximum, Average or Last Purchase. Any other text sets the policy to its default value. For a new material whose file has no such column, the policy is Actual.

Other columns​

ColumnWhat it does and how it is read
GiftsA number, zero or more.
Gifts for eachA number, zero or more.
Hide in Search WindowThe number 1 hides the material and 0 shows it.
Size, Location, Manufacturer, Source, Model, Type, Provenance, ColorText saved as it is.
Value Added TaxA number, zero or more. If the Egyptian tax system is on and the value is greater than zero, the program rewrites the material's tax with this value.
Barcode for the second unit and for the third unitThe barcode text.
Re-Order Point, Minimum Limit, Maximum LimitNumbers. If you chose the minimum or the maximum, after the import the program raises the maximum to the minimum if it is lower, and keeps the re-order point between the two limits.
Expiry Date, Production DateThe text with the same name, or 1, turns date tracking on for the material. Any other value turns it off.
Security LevelGreen or 1, Yellow or 2, Red or 3. Any other value means 1.
GPCThe global material code.
Serial Number, Force on Input, Force on OutputThe text with the same name, or 1, turns the option on. Any other value turns it off. These columns are not read for a fixed asset material. If the material has no serial numbers the program turns off the forcing after the import.
Picture FileThe path of a picture file. The program adds it as the default picture of the material.
Custom fieldsThe custom fields of materials defined in the file appear at the end of the list. The value is read as text, a date or a number according to the field type.

Fixed asset columns​

These columns show only if your licence includes the fixed assets feature. They are filled for a line of type Fixed Asset, and they must come after all the material columns, otherwise the message "Asset fields must come after material fields" appears. Accounts are written with the code of an existing final account.

ColumnWhat it does
Depreciation TypeThe number of the depreciation method.
Useful Life In YearsThe useful life.
Asset Account, Depreciation Account, Accumulated Depreciation AccountAccount codes.
Specifications, NotesText.
Maintenance Account, Assessment Account, Capital Profit Account, Capital Loss AccountAccount codes.

For a fixed asset the program turns on serial numbers with forcing on input and output.

Group lines at the top of the file​

The file can start with lines that define groups before the materials. Such a line starts with the text <Grp> in its first column, then the group code, the group name and the code of the parent group. The program counts these lines from the start of the file up to the first line that does not start with <Grp>, and leaves them out of the Start line count. It ignores the line if a group with the same code exists. Otherwise it creates the group and looks for the parent group by code. If it finds none, the group becomes a top-level group. The new group gets the accounts settings copied from its parent group.

How the program matches materials​

The program matches each line with the materials of the open company file by code alone, ignoring letter case. Then it decides what to do:

CaseWhat the program doesNote in the report
The code does not exist in the open company fileAdds a new card, unless you ticked Just update existing materials' cards information.Add; or Ignore with no note when that option is ticked.
The code exists and Update cards for materials with matching codes is tickedUpdates the card with the chosen columns.Modify.
The code exists and the option is not tickedIgnores the line and leaves the card as it is.Ignore and "Code already exists".
The code is repeated inside the fileProcesses the first line and ignores the second. If the code appears three times or more, it ignores all of them.Ignore and "Code already exists".
The name exists on another material with a different code, and the file does not allow repeated material namesIgnores the line. If the name is repeated inside the file, the first line is processed and the others are ignored.Ignore and "Duplicate Name".
The barcode exists on another material or on another line of the file, and the option Prevent duplicating barcodes is onIgnores the line or lines and does not add them.Ignore and "Duplicated Barcode".
The line has no group name (or no group code if you chose the group code column)Ignores the line.Ignore and "No group found".

Group rules: if the columns include Group Code the program looks for the group by its code, otherwise by its name. If it does not find it, it creates a new top-level group with that name and code, using one in place of the other when one is empty. Materials take the accounts of their group: the program clears the old accounts link of each imported material and copies the link of its group.

Two program options control the name and barcode rules: Allow duplicating material name (off by default) and Prevent duplicating barcodes. See Program options.

What happens to cards and lines​

New materials: The program fills the columns you did not choose with defaults: zero prices, limits and numbers, empty texts, security level 1, price policy Actual, the default currency and its parity, the first unit as the default unit, the default branch of the file, and a stock material. Then it writes the columns you chose.

Existing materials (when updating): The program writes only the columns you chose and leaves the others alone. Warning: a chosen column whose cell is empty writes an empty value or zero over the current value. Two options stop the name and the group from changing.

Ignored materials: The program does not save the line. It writes code-name into a temporary text file whose path the final message shows, and counts it among "cards containing errors".

Barcode: After saving each material the program rebuilds its main barcodes in the extended barcodes table. If that fails for one material the program undoes the whole import and stops.

Final message and result report​

When the import ends a message shows: "Importing materials cards has been completed." then "Total imported materials", and, if some lines were ignored, "Total cards containing errors (not imported)" with the path of the temporary file, and, if cards were updated, "Total cards updated" and "Total cards appended".

Then the Imported Materials Cards window appears with the question "Do you want to preview imported materials and groups." and the buttons Preview and Close. Preview opens the Import Materials report in the report viewer (see Report viewer). Its header shows Start Time and End Time, and its grid has three columns:

ColumnDescription
NameThe material name, or the group name for a line that stands for a group that was created.
OperationAdd, Modify or Ignore.
NotesThe reason a line was ignored: "Code already exists", "Duplicate Name", "Duplicated Barcode" or "No group found". In update mode, when the file contains the second or third unit conversion factor, the column also shows a dedicated note for each material that already has movements, saying the conversion factor cannot be changed for a material with movements.

The right-click menu of a material row has the command View Group Card... for its group, then the commands the program adds automatically for the material key: Display Material Movement..., Display Daily Movement... and Display Material Card.... The first two show only for users who have the permission of their reports.

Messages​

MessageWhy it appearsWhat to do
"The file doesn't exist"No file has the path typed in step 2.Correct the path.
"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 Material Code or Material Name, or neither the group name nor the group code (the text shows "Group Name Or Group Code").Choose the required field.
"When selecting "Force on Input" or "Force on Output", you have also to select "Serial No.""You chose Force on Input or Force on Output without Serial Number.Choose Serial Number too.
"Asset fields must come after material fields"A fixed asset column is before one of the material columns.Reorder the columns.
"Do you want start importing materials cards"You clicked Start and the columns are valid.Choose Yes to start.
"Are you sure you want to cancel materials cards import?"You clicked Cancel.Choose Yes to leave.
"Can't open file:" followed by a temporary file nameThe program could not create the temporary file for ignored lines.Check free space and write access to the temporary folder.
"Importing materials cards has been completed." and the totalsThe import ended.Read the numbers and open the report if needed.

This page applies to alameen ERP 10, version 10.1.79.764.