Form ImportStockFromExcelForm
- Unit name: Forms.ImportStockFromExcel
- Form name: TImportStockFromExcelForm
- Old form name: form212 (unit212)
Synopsis
This form allows to import an invoice (stock) from an excel sheet.
Functionalities
The form allows to select :
* A supplier.
* A stock code. (default 75)
* A customs stock code. (One of 25 or 99, default 99)
* A location. (default H.99.01.A)
* A predefined import format
1. Article, description, barcode, Quantity (the default)
2. Article, description, Quantity
3. Article, description, Quantity
4. Custom format.
(when selected, an edit box appears where fieldnames can be entered separated by commas/spaces)
* An excel file.
* A checkbox to import the first line
* A checkbox to open the invoice after import.
* An edit box for the invoice name.
* An 'Import' button to execute Import action.
* A 'View' button to execute View action
Actions
View
- Active when the import format and excel file are selected.
- previews the contents that will be imported: the contents is shown in a grid.
Import
- When all parameters are entered, a button 'import' becomes active.
- When clicked, it will show the excel file contents if it is not yet shown, and will then proceed to import the invoice.
- The invoice number is taken from the edit box.
If no invoice number was specified, it is set to
'R-'+date in YYYMMdd-hhnnss format and shown in the edit box.
- If an invoice number was specified, its existence is checked. If it exists, the user is asked to confirm that he wants to append to the existing invoice.
- The lines from the excel sheet are imported taking into account the import format, and the setting for 'import first line'.
- For custom format, an empty field name in the list means the column will be skipped.
-
Valid field names are the field names as they exist in the database and for which a field exists in the TArticleHeader record.
-
After the invoice was imported, the dialog stays open, unless the user opted to open the invoice after import, in which case ReceptionForm is shown with the invoice number as initial invoice to be shown.
Tables/Views
- SUPPLIERS For the supplier selection. (global lookup)
- StockCode for the stockcode selection. (global lookup)
- Location for the location selection. (global lookup)
Needed Service Calls
Stock.CreateInvoice
To create the new invoice if a new invoice must be made.
Stock.AddArticlesToInvoice
To add the articles to the invoice. AllowCreate is set to true.