Special examples on entering ID can be proceeded with a stored
procedure which will convert the entry (usually scanned value) in data
that the program requires to function in a normal way. This way, you can
handle following cases:
- EAN/UCC 128 code
- Codes with a product variation
- Atypical codes or
- Other combinations.
If a stored procedure exists on the server, the
program will definitely run it. If the procedure does not exist on the server,
the program will function in an usual way.
The parameters for the procedure are fixed. Take care, the procedure returns
the record set with at least following fields:
- ISOK: it can be T or F and report if the operation succeeded;
- ERRMSG: is a user warning when an error occurs;
- IDENT: Item ID;
- KOLICINA: Quantity;
- SERIALNO: Serial number.
The program can beside these fields return other fields that are in Pantheon,
except user fields which are in the table
PROMETPOZ.
 |
If you enter items through the stored procedure, you cannot move with the ENTER
key to the next field.
Functionalities of cursor and TAB keys do not change.
|
 |
When the procedure will return an item, the program will check if this item is correct (if it is entered in the Items register).
It is the same for the check of serial numbers.
|
 |
set nocount on
is a mandatory command because the procedure must return always just one
record set.
|
 |
The range of characters in the ERRMSG field will always display, if ISOK =
'T' or 'F'.
This way, you can use this possibility to display a certain warning.
|
 |
If you use this type of searching (entering) IDs, then you cannot use:
and have to integrate it in the procedure manually!
|
Example of a scanned code with an identifier, ID, quantity and
serial number
Let us say, there is an item with the following ID form (i.e. food article):
01EEEEEEEEEEEEEEKKKKKDDDDDDD
where
- 01 - is an identifier for a compound item;
- EEEEEEEEEEEEEE - is a 14 digit EAN code of the
item;
- KKKKK - is a 5 digit quantity in grams (ITEM
is standardized in KG);
- DDDDDDD - is an expiration date of the item.
If an item does not have na 01 identifier at the beginning, than the item is
regarded as a normal item and will be transferred in the Pantheon.
The stored procedure that has to be set up for this case is as following:
create procedure [dbo].[dl_HE_MSIdentSetText]
@cKljuc Char(13), -- the key for the document on which you have run the entry of the code
@nPoz SmallInt, -- line on which the entry of the code was activated (not required!!)
@cSubjekt Char(30), -- customer or supplier of the document
@cText VarChar(512) -- entered value
as
set nocount on
if Left(@cText,2) = '01' -- is this a compound code?
select 'T' as acISOK, '' as acERRMSG, SubString(@cText,3,14) as acIDENT,
(cast(SubString(@cText,18,5) as money) / 1000) as anQty,
SubString(@cText,24,10) as acSERIALNO
else -- no, then return the scanned as item
select 'T' as acISOK, '' as acERRMSG, @cText as acIDENT,0 as anQty,'' as acSERIALNO
Example of a scanned code with a product variation
Let us say, there is an item with the following ID form (i.e. shoes):
EEEEEEEEEEEEEEBBBBVVV
where:
- EEEEEEEEEEEEEE - is 14 digit EAN code of the item;
- BBBB - is 4 digit code of the color;
- VVV - is 3 digit code of the size.
Item are mixed up so you can scan any of the items. The item will tell you if
it contains a product variation or not.
The stored procedure that has to be set up for this case is as following:
create procedure [dbo].[dl_HE_MSIdentSetText]
@cKljuc Char(11), -- the key for the document on which you have run the entry of the code
@nPoz SmallInt, -- line on which the entry of the code was activated (not required!!)
@cSubjekt Char(30), -- customer or supplier of the document
@cText VarChar(512) -- entered value
as
set nocount on
declare
@cIdent char(16),
@cTipSerijske char(1)
set @cIdent = Left(@cText,14)
set @cTipSerijske = null
select @cTipSerijske = SERIALNO
from IDENT
where IDENT = @cIdent
if @cTipSerijske is null
select 'F' as ISOK, 'Ni identa' as ERRMSG, '' as IDENT,0 as KOLICINA,'' as SERIALNO
else
if @cTipSerijske = 'P' then
select 'T' as ISOK, '' as ERRMSG, @cIdent as IDENT,0 as KOLICINA,Right(@cText,7) as SERIALNO
else
select 'T' as ISOK, '' as ERRMSG, @cText as IDENT,0 as KOLICINA,'' as SERIALNO