The StkTrans table is used to perform stock movements in and out. 


Field Mapping (mandatory fields in RED)

E2S Field

SAGE Field

Location within Sage

Data Type

Notes

ID

N/A

N/A

int

Used internally and not uploaded to Sage

Product

A/C

Product Record - Activity Screen

nvarchar(30)

The key field for this tab. This will be the Product code this adjustment is for

Date

Date

Product Record - Activity Screen

datetime


Ref

Ref

Product Record - Activity Screen

nvarchar(30)


Details

Details

Product Record - Activity Screen

nvarchar(60)


Qty

(+) Qty In / (-) Qty Out

Product Record - Activity Screen

decimal(18, 2)

Any positive value will result in a Qty In and negatives a Qty Out transaction

ProjectCode

Project Ref

 Record - Activity Screen

nvarchar(8)


CostCode

Cost Code

 Record - Activity Screen

nvarchar(8)


CostPrice

Cost Price

 Record - Activity Screen

decimal(18, 2)

Used on Adj In transactions only

Status

N/A

N/A

nvarchar(8)

Used internally and not uploaded to Sage. Set to 'New', 'Error' or 'Sent' normally


Script to create the table...


CREATE TABLE [dbo].[StkTrans](

       [ID] [int] IDENTITY(1,1) NOT NULL,

       [Product] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

       [Date] [datetime] NULL,

       [Ref] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

       [Details] [nvarchar](60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

       [Qty] [decimal](18, 2) NULL,

       [ProjectCode] [nvarchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

       [CostCode] [nvarchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

       [CostPrice] [decimal](18, 2) NULL,

       [Status] [nvarchar](8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL CONSTRAINT [DF_StkTrans_Status]  DEFAULT (N'New'),

 CONSTRAINT [PK_StkTrans] PRIMARY KEY CLUSTERED 

(

       [ID] ASC

)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]