Table Article
DDL
create sequence seqArticle as bigint start with 1;
create table Article (
aID bigint not null default next value for seqArticle,
aCreatedOn datetime not null default sysdatetime(),
aCreatedByFK pointer not null,
aChangedOn datetime not null default sysdatetime(),
aChangedByFK pointer not NULL,
aCode longName not null,
aDescription Description not null,
aWeight Amount not null default 0.0,
aWeightUnits shortName not null default '',
aVolume Amount not null default 0.0,
aVolumeUnits shortName not null default '',
aBarcode1 dbo.Name not null default '',
aBarcode2 dbo.Name not null default '',
aBarcode3 dbo.Name not null default '',
aBarcode4 dbo.Name not null default '',
aBarcode5 dbo.Name not null default '',
aComments description not null default '',
aNotes1 description not null default '',
aNotes2 description not null default '',
aNotes3 description not null default '',
aNotes4 description not null default '',
aAccessories BIT NOT NULL DEFAULT 0,
aFragile BIT NOT NULL DEFAULT 0,
aLength Amount NOT NULL DEFAULT 0,
aWidth Amount NOT NULL DEFAULT 0,
aHeight Amount NOT NULL DEFAULT 0,
aDimensionUnits ShortName not null default '',
aIsPacked BIT NOT NULL DEFAULT 0,
aHasLotNr BIT NOT NULL DEFAULT 0,
aHasExpiryDate BIT NOT NULL DEFAULT 0,
aExpiresSelectFirst BIT NOT NULL DEFAULT 0,
aCustomerFK pointer not null,
aSubComponentsTotalQuantity INT NOT NULL DEFAULT 0,
aDisplayWhenSelected description not null default '',
aDisplayWhenDeleted description not null default '',
aDisplayWhenMoved description not null default '',
aADRUniqueName dbo.name not null default '',
aADRDescription description not null default '',
aADRClass dbo.name not null default '',
aADRPackage dbo.name not null default '',
aADRClassification dbo.name not null default '',
aADRLabel dbo.name not null default '',
aADRLiquidQuantity dbo.name not null default 0,
aADRDangerousWeight Amount not null default 0,
aCurrentStock Amount not null default 0,
CONSTRAINT pkArticle PRIMARY key (aID)
);
-- check if this can be aCode, would be better
create unique index udxCodeCustomer (aCustomerFK,aCode);
Default Data
insert into Article (aID, aCreatedByFK, aChangedByFK, Code, Description )
values (0,0,0,'?','Unknown article');
Mapping
ARTICLE
Conversion ID: Article.cnvArticleID
New | Old |
---|---|
aID | aID |
aCreatedOn | FILLDATE |
aCreatedByFK | PCNAME |
aChangedOn | FILLDATE |
aChangedByFK | PCNAME |
aCode | NAME |
aDescription | NAME2 |
aWeight | WEIGHT |
aWeightUnits | UMW |
aVolume | VOL |
aVolumeUnits | UMV |
aBarcode1 | EANCODE |
aBarcode2 | EANCODE1 |
aBarcode3 | EANCODE2 |
aBarcode4 | EANCODE3 |
aBarcode5 | EANCODE4 |
aComments | Comments |
aNotes1 | Notes1 |
aNotes2 | Notes2 |
aNotes3 | Notes3 |
aNotes4 | Notes4 |
aAccessories | Accessories |
aFragile | Fragile |
aLength | Length |
aWidth | Width |
aHeight | Height |
aDimensionUnits | ADUNIT |
aIsPacked | PackedAlready |
aHasLotNr | FLOTNO |
aHasExpiryDate | FEXPIRYDATE |
aExpiresSelectFirst | aExpiresSelectFirst |
aCustomerFK | FSUpplier |
aSubComponentsTotalQuantity | SubComponentsTQTY |
aDisplayWhenSelected | Pop_up_flag |
aDisplayWhenDeleted | Pop_up_flag_del |
aDisplayWhenMoved | Pop_up_flag_mov |
aADRUniqueName | ADR_UN |
aADRDescription | ADR_NAME |
aADRClass | ADR_CLASS |
aADRPackage | ADR_PACKAGE |
aADRClassification | ADR_CLASSIFICATION |
aADRLabel | ADR_LABEL |
aADRLiquidQuantity | ADR_LQ |
aADRDangerousWeight | DangerousWeight |