MYOB EXO Business Job Costing
List of entities
Entity details
Entity: GLACCS
CommentThis table contains details of all General Ledger accounts.
Primary key columnsACCNO

Attributes:
Column namePrimary keyData typeNot NULLComment
ACCNOYesINTEGERYesThe unique GL account number.
NAMENoVARCHAR(40)NoThe account name.
DRCRNoCHAR(1)NoThis field is set to 'C' for Credit accounts or 'D' for Debit accounts.
SECTIONNoINTEGERNoThis field is set to 0 for Profit and loss accounts or 1 for Balance sheet accounts.
OPENINGBALNoFLOAT(53)NoThe account's opening balance.
BALANCENoFLOAT(53)NoThe account's balance.
USESUBCODESNoCHAR(1)NoNot used.
REPORTCODENoVARCHAR(15)NoThe report code used by the GL account.
TAXSTATUSNoINTEGERNoThe Override GST rate specified for the GL account. A value of -1 corresponds to the AUTO SELECT RATE option.
CURRENCYNONoINTEGERNoThe ID number of the currency that the GL account is in.
ISACTIVENoCHAR(1)NoThis field contains 'Y' if the GL account is active.
ACCGROUPNoINTEGERNoThe GL account's Account Group.
ALLOWJOURNALNoCHAR(1)NoThis field is set to 'Y' if the GL account allows journals.
LAST_UPDATEDNoDATETIMENoThe date and time when the GL account was last updated.
BALSHEETACCTOTNoASNoThe balance sheet total for the account.
BALANCE_SHEET_TYPENoINTEGERYesFor balance sheet accounts, this field indicates the balance sheet type. Will be one of:
-1 = Not a balance sheet account
0 = Asset
1 = Liability
2 = Equity
NOTESNoVARCHAR(4096)NoAny notes on the GL account.
EXCLUDE_FROM_REVALNoCHAR(1)NoIf this field is set to 'Y', the account is excluded from revaluation.
PRIVATE_ACCNoCHAR(1)YesThis field is set to 'Y' if the GL account is a private account.
CREATED_DATENoDATETIMENoThe date and time that the GL account was created.

Relationships:
NameRelationship typeParentChildCardinality
CURRENCIES_GLACCSNon IdentifyingCURRENCIESGLACCSZero Or More
GLACCS_CR_TRANSNon IdentifyingGLACCSCR_TRANSZero Or More
GLACCS_DR_TRANSNon IdentifyingGLACCSDR_TRANSZero Or More
GLACCS_JOBCOST_HDRNon IdentifyingGLACCSJOBCOST_HDRZero Or More
GLACCS_JOBCOST_HDR_SALESNon IdentifyingGLACCSJOBCOST_HDRZero Or More
GLACCS_JOBCOST_LINESNon IdentifyingGLACCSJOBCOST_LINESZero Or More
GLACCS_JOB_CONTRACT_BILLINGSNon IdentifyingGLACCSJOB_CONTRACT_BILLINGSZero Or More
GLACCS_JOB_CONTRACT_BILLINGS_SUBNon IdentifyingGLACCSJOB_CONTRACT_BILLINGSZero Or More
GLACCS_JOB_TRANSACTIONSNon IdentifyingGLACCSJOB_TRANSACTIONSZero Or More
GLACCS_OPPORTUNITY_QUOTENon IdentifyingGLACCSOPPORTUNITY_QUOTEZero Or More
GLACCS_STOCK_GROUPSNon IdentifyingGLACCSSTOCK_GROUPSZero Or More
GLACCS_STOCK_GROUPS_COSNon IdentifyingGLACCSSTOCK_GROUPSZero Or More
GLACCS_STOCK_GROUPS_PNon IdentifyingGLACCSSTOCK_GROUPSZero Or More
GLACCS_STOCK_ITEMSNon IdentifyingGLACCSSTOCK_ITEMSZero Or More
GLACCS_STOCK_ITEMS_COSNon IdentifyingGLACCSSTOCK_ITEMSZero Or More
GLACCS_STOCK_TRANSNon IdentifyingGLACCSSTOCK_TRANSZero Or More
GL_ACCS_STOCKITEMS_PONon IdentifyingGLACCSSTOCK_ITEMSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (PRIVATE_ACC)
Not NullColumn ConstraintNOT NULL (ACCNO)
Not NullColumn ConstraintNOT NULL (BALANCE_SHEET_TYPE)
CURRENCIES_GLACCSForeign KeyTable ConstraintFOREIGN KEY (CURRENCYNO) REFERENCES CURRENCIES(CURRENCYNO)
DF__GLACCS__ACCGROUP__613C58ECDefaultColumn ConstraintACCGROUP DEFAULT 0
DF__GLACCS__ALLOWJOU__2882FE7DDefaultColumn ConstraintALLOWJOURNAL DEFAULT Y
DF__GLACCS__BALANCE__3E082B48DefaultColumn ConstraintBALANCE DEFAULT 0
DF__GLACCS__BALANCE___40113AA2DefaultColumn ConstraintBALANCE_SHEET_TYPE DEFAULT -1
DF__GLACCS__CURRENCY__3A228BCBDefaultColumn ConstraintCURRENCYNO DEFAULT 0
DF__GLACCS__DRCR__3B2BBE9DDefaultColumn ConstraintDRCR DEFAULT D
DF__GLACCS__EXCLUDE___23CA01AFDefaultColumn ConstraintEXCLUDE_FROM_REVAL DEFAULT N
DF__GLACCS__ISACTIVE__58A712EBDefaultColumn ConstraintISACTIVE DEFAULT Y
DF__GLACCS__OPENINGB__3D14070FDefaultColumn ConstraintOPENINGBAL DEFAULT 0
DF__GLACCS__PRIVATE___13697CB4DefaultColumn ConstraintPRIVATE_ACC DEFAULT N
DF__GLACCS__SECTION__3C1FE2D6DefaultColumn ConstraintSECTION DEFAULT 0
DF__GLACCS__TAXSTATU__51700577DefaultColumn ConstraintTAXSTATUS DEFAULT 0
DF__GLACCS__USESUBCO__3FF073BADefaultColumn ConstraintUSESUBCODES DEFAULT N
PK__GLACCS__3A379A64Primary KeyTable ConstraintPRIMARY KEY (ACCNO)



Entity: JOBCOST_FLAGS
CommentThis table records the statuses for the various Job Flags on each job.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
JOBNONoINTEGERYesThe job's ID number.
INVOICEREADYNoCHAR(1)YesThis field contains 'Y' if the job's Invoice Ready flag is ticked.
ISACTIVENoCHAR(1)YesThis field contains 'Y' if the job's Active Job flag is ticked.
ISCOMPLETENoCHAR(1)YesThis field contains 'Y' if the job's Completed flag is ticked.
ISARCHIVEDNoCHAR(1)YesThis field contains 'Y' if the job's Archived Job flag is ticked.
FLAG01NoCHAR(1)YesThis field contains 'Y' if custom flag 1 is ticked for the job.
FLAG02NoCHAR(1)YesThis field contains 'Y' if custom flag 2 is ticked for the job.
FLAG03NoCHAR(1)YesThis field contains 'Y' if custom flag 3 is ticked for the job.
FLAG04NoCHAR(1)YesThis field contains 'Y' if custom flag 4 is ticked for the job.
FLAG05NoCHAR(1)YesThis field contains 'Y' if custom flag 5 is ticked for the job.
FLAG06NoCHAR(1)YesThis field contains 'Y' if custom flag 6 is ticked for the job.
FLAG07NoCHAR(1)YesThis field contains 'Y' if custom flag 7 is ticked for the job.
FLAG08NoCHAR(1)YesThis field contains 'Y' if custom flag 8 is ticked for the job.
FLAG09NoCHAR(1)YesThis field contains 'Y' if custom flag 9 is ticked for the job.
FLAG10NoCHAR(1)YesThis field contains 'Y' if custom flag 10 is ticked for the job.
FLAG11NoCHAR(1)YesThis field contains 'Y' if custom flag 11 is ticked for the job.
FLAG12NoCHAR(1)YesThis field contains 'Y' if custom flag 12 is ticked for the job.
FLAG13NoCHAR(1)YesThis field contains 'Y' if custom flag 13 is ticked for the job.
FLAG14NoCHAR(1)YesThis field contains 'Y' if custom flag 14 is ticked for the job.
FLAG15NoCHAR(1)YesThis field contains 'Y' if custom flag 15 is ticked for the job.

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_HDR_JOBCOST_FLAGSNon IdentifyingJOBCOST_HDRJOBCOST_FLAGSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (FLAG15)
Not NullColumn ConstraintNOT NULL (JOBNO)
Not NullColumn ConstraintNOT NULL (FLAG14)
Not NullColumn ConstraintNOT NULL (INVOICEREADY)
Not NullColumn ConstraintNOT NULL (FLAG13)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (FLAG12)
Not NullColumn ConstraintNOT NULL (ISCOMPLETE)
Not NullColumn ConstraintNOT NULL (FLAG11)
Not NullColumn ConstraintNOT NULL (ISARCHIVED)
Not NullColumn ConstraintNOT NULL (FLAG10)
Not NullColumn ConstraintNOT NULL (FLAG01)
Not NullColumn ConstraintNOT NULL (FLAG09)
Not NullColumn ConstraintNOT NULL (FLAG02)
Not NullColumn ConstraintNOT NULL (FLAG08)
Not NullColumn ConstraintNOT NULL (FLAG03)
Not NullColumn ConstraintNOT NULL (FLAG07)
Not NullColumn ConstraintNOT NULL (FLAG04)
Not NullColumn ConstraintNOT NULL (FLAG06)
Not NullColumn ConstraintNOT NULL (FLAG05)
DF__JOBCOST_F__FLAG0__0D65BF44DefaultColumn ConstraintFLAG01 DEFAULT N
DF__JOBCOST_F__FLAG0__0E59E37DDefaultColumn ConstraintFLAG02 DEFAULT N
DF__JOBCOST_F__FLAG0__0F4E07B6DefaultColumn ConstraintFLAG03 DEFAULT N
DF__JOBCOST_F__FLAG0__10422BEFDefaultColumn ConstraintFLAG04 DEFAULT N
DF__JOBCOST_F__FLAG0__11365028DefaultColumn ConstraintFLAG05 DEFAULT N
DF__JOBCOST_F__FLAG0__122A7461DefaultColumn ConstraintFLAG06 DEFAULT N
DF__JOBCOST_F__FLAG0__131E989ADefaultColumn ConstraintFLAG07 DEFAULT N
DF__JOBCOST_F__FLAG0__1412BCD3DefaultColumn ConstraintFLAG08 DEFAULT N
DF__JOBCOST_F__FLAG0__1506E10CDefaultColumn ConstraintFLAG09 DEFAULT N
DF__JOBCOST_F__FLAG1__15FB0545DefaultColumn ConstraintFLAG10 DEFAULT N
DF__JOBCOST_F__FLAG1__16EF297EDefaultColumn ConstraintFLAG11 DEFAULT N
DF__JOBCOST_F__FLAG1__17E34DB7DefaultColumn ConstraintFLAG12 DEFAULT N
DF__JOBCOST_F__FLAG1__18D771F0DefaultColumn ConstraintFLAG13 DEFAULT N
DF__JOBCOST_F__FLAG1__19CB9629DefaultColumn ConstraintFLAG14 DEFAULT N
DF__JOBCOST_F__FLAG1__1ABFBA62DefaultColumn ConstraintFLAG15 DEFAULT N
DF__JOBCOST_F__INVOI__09952E60DefaultColumn ConstraintINVOICEREADY DEFAULT N
DF__JOBCOST_F__ISACT__0A895299DefaultColumn ConstraintISACTIVE DEFAULT Y
DF__JOBCOST_F__ISARC__0C719B0BDefaultColumn ConstraintISARCHIVED DEFAULT N
DF__JOBCOST_F__ISCOM__0B7D76D2DefaultColumn ConstraintISCOMPLETE DEFAULT N
DF__JOBCOST_F__JOBNO__08A10A27DefaultColumn ConstraintJOBNO DEFAULT 0
JOBCOST_HDR_JOBCOST_FLAGSForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)



Entity: JOBCOST_FLAGSDESC
CommentThis table records descriptions for the customisable Job Flags.
Primary key columnsFLAGCODE

Attributes:
Column namePrimary keyData typeNot NULLComment
FLAGCODEYesVARCHAR(8)YesThe Job Flag's ID number.
FLAGDESCNoVARCHAR(60)NoThe Job Flag's description.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (FLAGCODE)
PK__JOBCOST_FLAGSDES__1CA802D4Primary KeyTable ConstraintPRIMARY KEY (FLAGCODE)



Entity: JOBCOST_GENERAL_INFO
CommentThis table is no longer used - Job Costing configuration options are now stored as profile settings.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesNo longer used.
SOFTWARE_VERSIONNoINTEGERNoNo longer used.
DATAVERSIONNoINTEGERNoNo longer used.
QUOTE_TERMSNoVARCHAR(1000)NoNo longer used.
STOCKLOCNoINTEGERNoNo longer used.
JOBCATNoINTEGERNoNo longer used.
SUBSADDUPNoVARCHAR(1)NoNo longer used.
JOBSTATNoVARCHAR(1)NoNo longer used.
JOBTYPENoINTEGERNoNo longer used.
MOVE_STOCKNoCHAR(1)YesNo longer used.
COSTGLSQLNoVARCHAR(500)NoNo longer used.
SALESGLSQLNoVARCHAR(500)NoNo longer used.
DEFDAYSNoINTEGERNoNo longer used.
DEFHOURSNoINTEGERNoNo longer used.
OURREFNoVARCHAR(30)NoNo longer used.
PRINTDESCNoVARCHAR(1)NoNo longer used.
OPTION_1NoVARCHAR(1)NoNo longer used.
OPTION_2NoVARCHAR(1)NoNo longer used.
OPTION_3NoVARCHAR(1)NoNo longer used.
OPTION_4NoVARCHAR(1)NoNo longer used.
OPTION_5NoVARCHAR(1)NoNo longer used.
OPTION_6NoVARCHAR(1)NoNo longer used.
OPTION_7NoVARCHAR(1)NoNo longer used.
OPTION_8NoVARCHAR(1)NoNo longer used.
OPTION_9NoVARCHAR(1)NoNo longer used.
OPTION_10NoVARCHAR(1)NoNo longer used.
JOBNO_PROMPTNoVARCHAR(1)NoNo longer used.
SCHEDULERNoVARCHAR(1)NoNo longer used.
TIMESELECTSQLNoVARCHAR(255)NoNo longer used.
COSTSELECTSQLNoVARCHAR(255)NoNo longer used.
STOCKCOSTNoINTEGERNoNo longer used.
GLACC_TO_USENoINTEGERNoNo longer used.
WORKSHEETTYPENoINTEGERNoNo longer used.
SHOWMAINNoVARCHAR(1)NoNo longer used.
WIPNOTSOHNoVARCHAR(1)NoNo longer used.
DEFNONSTOCKCODENoVARCHAR(23)NoNo longer used.
USE_SALES_ORD_NONoCHAR(1)YesNo longer used.
QUOTECOSTNoINTEGERYesNo longer used.
DEFFOLLOWUPDAYSNoINTEGERYesNo longer used.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (DEFFOLLOWUPDAYS)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (QUOTECOST)
Not NullColumn ConstraintNOT NULL (USE_SALES_ORD_NO)
Not NullColumn ConstraintNOT NULL (MOVE_STOCK)
DF__JOBCOST_G__DATAV__5674B1B6DefaultColumn ConstraintDATAVERSION DEFAULT 0
DF__JOBCOST_G__DEFFO__05C49D7CDefaultColumn ConstraintDEFFOLLOWUPDAYS DEFAULT 0
DF__JOBCOST_G__GLACC__5D21AF45DefaultColumn ConstraintGLACC_TO_USE DEFAULT 0
DF__JOBCOST_G__JOBCA__5768D5EFDefaultColumn ConstraintJOBCAT DEFAULT 0
DF__JOBCOST_G__JOBTY__585CFA28DefaultColumn ConstraintJOBTYPE DEFAULT 0
DF__JOBCOST_G__MOVE___59511E61DefaultColumn ConstraintMOVE_STOCK DEFAULT N
DF__JOBCOST_G__QUOTE__34DEB3C1DefaultColumn ConstraintQUOTECOST DEFAULT 1
DF__JOBCOST_G__SHOWM__5F09F7B7DefaultColumn ConstraintSHOWMAIN DEFAULT N
DF__JOBCOST_G__SOFTW__55808D7DDefaultColumn ConstraintSOFTWARE_VERSION DEFAULT 0
DF__JOBCOST_G__STOCK__5C2D8B0CDefaultColumn ConstraintSTOCKCOST DEFAULT 0
DF__JOBCOST_G__USE_S__33EA8F88DefaultColumn ConstraintUSE_SALES_ORD_NO DEFAULT N
DF__JOBCOST_G__WIPNO__5FFE1BF0DefaultColumn ConstraintWIPNOTSOH DEFAULT N
DF__JOBCOST_G__WORKS__5E15D37EDefaultColumn ConstraintWORKSHEETTYPE DEFAULT 1
PK__JOBCOST_GENERAL___548C6944Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOBCOST_HDR
CommentThis table contains header information for all jobs.
Primary key columnsJOBNO

Attributes:
Column namePrimary keyData typeNot NULLComment
JOBNOYesINTEGERYesA unique ID number for the job.
QUOTEDATENoDATETIMENoThe quote date on the job.
STARTDATENoDATETIMENoThe job's start date.
DUEDATENoDATETIMENoThe date when the job is due.
COMPLETEDNoDATETIMENoThe date when the job was completed.
ESTIMATENoFLOAT(53)NoAn estimate of the job's value.
INVOICEDNoFLOAT(53)NoThe amount of the job that has been invoiced.
THETIMENoFLOAT(53)NoTotal amount on timesheets for the job.
MATERIALSNoFLOAT(53)NoTotal amount on the Costs tab for the job.
DEF_OVERHEADNoFLOAT(53)NoThe default overhead on the job.
MATERIALSCOSTNoFLOAT(53)NoThe total costs on the Costs tab.
ESTIMATECOSTNoFLOAT(53)NoThe estimated cost of the job.
THETIMECOSTNoFLOAT(53)NoThe total costs on the Timesheets tab.
INVOICEDCOSTNoFLOAT(53)NoThe total cost of all invoiced lines on the job.
JOBCODENoVARCHAR(15)NoAn alphanumeric ID code for the job.
ACCNONoINTEGERNoThe number of the Debtor account that the job belongs to.
CUSTORDNONoVARCHAR(15)NoThe customer's order number.
STATUSNoCHAR(1)NoThe ID code of the job's status (from JOB_STATUS).
TITLENoVARCHAR(60)NoA descriptive title for the job.
CATEGORYNoINTEGERNoThe ID number of the job's category (from JOB_CATEGORIES).
JOBTYPENoINTEGERNoThe ID number of the job's type (from JOB_TYPES).
STAFFNONoINTEGERNoThe EXO Business staff member responsible for entering the job.
ACTIONBYNoINTEGERNoThe staff member who is the Job Manager for the job.
MASTER_JOBNONoINTEGERYesIf the job is a sub-job, this field stores the ID number of the master job.
COSTGLNoINTEGERNoThe Cost GL account.
SALESGLNoINTEGERNoThe P&L revenue account for journals when invoicing.
SERIALNONoVARCHAR(50)NoReference.
CONTACTNoVARCHAR(50)NoThe contact person associated with the job.
PRIVATE_NOTENoCHAR(1000)NoAny notes on the job.
COSTSUBGLNoINTEGERNoThe Cost GL sub-account.
SALESSUBGLNoINTEGERNoThe P&L revenue sub-account for journals when invoicing.
DEL_ADDRNoINTEGERNoDelivery address.
CONTACTNONoINTEGERNoThe ID number of the contact person on the job.
DELADDR1NoVARCHAR(30)NoDelivery address line 1.
DELADDR2NoVARCHAR(30)NoDelivery address line 2.
DELADDR3NoVARCHAR(30)NoDelivery address line 3.
DELADDR4NoVARCHAR(30)NoDelivery address line 4.
DELADDR5NoVARCHAR(30)NoDelivery address line 5.
DELADDR6NoVARCHAR(30)NoDelivery address line 6.
WRITE_OFF_COSTNoFLOAT(53)NoThe total cost of all written off lines on the job.
TOTAL_HOURSNoFLOAT(53)NoThe total hours on the job.
EST_HOURSNoFLOAT(53)NoEstimated hours on the job.
ASSET_COSTNoFLOAT(53)NoThe cost of the asset(s) created on the job.
ASSET_VALUENoFLOAT(53)NoThe value of the asset(s) created on the job.
BRANCHNONoINTEGERNoThe job's branch.
ISACTIVENoCHAR(1)YesThis field contains 'Y' if the job is currently active.
HASUNBILLEDNoCHAR(1)Yes
INVOICEREADYNoCHAR(1)Yes
CALLBACKDATENoDATETIMENoThe Follow Up date on the job.
ENTRYDATENoDATETIMENoThe date and time when the job was entered.
TOTALVALUENoASNoThe total value of the job (Timesheets and Costs tabs).
TOTALCOSTNoASNoThe total cost of the job (Timesheets and Costs tabs).
WIPLOCNoINTEGERNoThe Work in Progress location for the job.
EXCHRATENoFLOAT(53)YesThe exchange rate used by the job.
RETENTION_RATENoFLOAT(53)YesThe base retention rate on the job.
RETENTION2_RATENoFLOAT(53)YesThe Level 2 retention rate on the job.
RETENTION2_MINNoFLOAT(53)YesThe Minimum Value for the Level 2 Retention on the job.
RETENTION3_RATENoFLOAT(53)YesThe Level 3 retention rate on the job.
RETENTION3_MINNoFLOAT(53)YesThe Minimum Value for the Level 3 Retention on the job.
ALLOWANCENoFLOAT(53)Yes
BILLINGMODENoINTEGERNoThe billing mode on the job. Will be one of:
0 = Charge-up
1 = Invoice ex-quote
2 = Manufacture - output items
3 = Progress invoices
PROJ_SEQNONoINTEGERNoThe ID number of the project that the job belongs to.
DESCRIPTIONNoVARCHAR(5000)NoThe job's description.
OPPORTUNITY_SEQNONoINTEGERNoThe ID number of the Opportunity (EXO CRM) that the job is associated with, if there is one.
CAMPAIGN_WAVE_SEQNONoINTEGERNoThe ID number of the campaign wave (EXO CRM) that the job is associated with, if there is one.
LINECHARGE_WRITEOFFNoFLOAT(53)NoThis field stores the sum of value of all JOB_TRANSACTIONS.LINECHARGE_WRITEOFF values on the transaction lines.

Relationships:
NameRelationship typeParentChildCardinality
BRANCHES_JOBCOST_HDRNon IdentifyingBRANCHESJOBCOST_HDRZero Or More
CAMPAIGN_WAVE_JOBCOST_HDRNon IdentifyingCAMPAIGN_WAVEJOBCOST_HDRZero Or More
DR_ACCS_JOBCOST_HDRNon IdentifyingDR_ACCSJOBCOST_HDRZero Or More
GLACCS_JOBCOST_HDRNon IdentifyingGLACCSJOBCOST_HDRZero Or More
GLACCS_JOBCOST_HDR_SALESNon IdentifyingGLACCSJOBCOST_HDRZero Or More
JOBCOST_HDR_INWARDS_GOODS_LINESNon IdentifyingJOBCOST_HDRINWARDS_GOODS_LINESZero Or More
JOBCOST_HDR_JOBCOST_FLAGSNon IdentifyingJOBCOST_HDRJOBCOST_FLAGSZero Or More
JOBCOST_HDR_JOBCOST_LINESNon IdentifyingJOBCOST_HDRJOBCOST_LINESZero Or More
JOBCOST_HDR_JOBCOST_LINES_MASTERNon IdentifyingJOBCOST_HDRJOBCOST_LINESZero Or More
JOBCOST_HDR_JOB_CONTRACT_BILLINGSNon IdentifyingJOBCOST_HDRJOB_CONTRACT_BILLINGSZero Or More
JOBCOST_HDR_JOB_CONTRACT_BILLINGS_MASTERNon IdentifyingJOBCOST_HDRJOB_CONTRACT_BILLINGSZero Or More
JOBCOST_HDR_JOB_HISTNon IdentifyingJOBCOST_HDRJOB_HISTZero Or More
JOBCOST_HDR_JOB_OUTPUT_ITEMSNon IdentifyingJOBCOST_HDRJOB_OUTPUT_ITEMSZero Or More
JOBCOST_HDR_JOB_RESOURCE_ALLOCATIONNon IdentifyingJOBCOST_HDRJOB_RESOURCE_ALLOCATIONZero Or More
JOBCOST_HDR_JOB_TIMESHEETSNon IdentifyingJOBCOST_HDRJOB_TIMESHEETSZero Or More
JOBCOST_HDR_JOB_TIMESHEETS_TITLENon IdentifyingJOBCOST_HDRJOB_TIMESHEETSZero Or More
JOBCOST_HDR_JOB_TRANSACTIONSNon IdentifyingJOBCOST_HDRJOB_TRANSACTIONSZero Or More
JOBCOST_HDR_JOB_TRANSACTIONS_MASTERNon IdentifyingJOBCOST_HDRJOB_TRANSACTIONSZero Or More
JOBCOST_HDR_TASKSNon IdentifyingJOBCOST_HDRTASKSZero Or More
JOBCOST_PROJ_JOBCOST_HDRNon IdentifyingJOBCOST_PROJJOBCOST_HDRZero Or More
JOB_CATEGORIES_JOBCOST_HDRNon IdentifyingJOB_CATEGORIESJOBCOST_HDRZero Or More
JOB_STATUS_JOBCOST_HDRNon IdentifyingJOB_STATUSJOBCOST_HDRZero Or More
JOB_TYPES_JOBCOST_HDRNon IdentifyingJOB_TYPESJOBCOST_HDRZero Or More
OPPORTUNITY_JOBCOST_HDRNon IdentifyingOPPORTUNITYJOBCOST_HDRZero Or More
STAFF_JOBCOST_HDRNon IdentifyingSTAFFJOBCOST_HDRZero Or More
STAFF_JOBCOST_HDR_MGRNon IdentifyingSTAFFJOBCOST_HDRZero Or More

Indexes:
NameIndex columnsIndex type
SK1_JOBCOST_HDRJOBCODE ASCUNIQUE

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ALLOWANCE)
Not NullColumn ConstraintNOT NULL (JOBNO)
Not NullColumn ConstraintNOT NULL (RETENTION3_MIN)
Not NullColumn ConstraintNOT NULL (RETENTION3_RATE)
Not NullColumn ConstraintNOT NULL (RETENTION2_MIN)
Not NullColumn ConstraintNOT NULL (RETENTION2_RATE)
Not NullColumn ConstraintNOT NULL (RETENTION_RATE)
Not NullColumn ConstraintNOT NULL (MASTER_JOBNO)
Not NullColumn ConstraintNOT NULL (EXCHRATE)
Not NullColumn ConstraintNOT NULL (INVOICEREADY)
Not NullColumn ConstraintNOT NULL (HASUNBILLED)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
BRANCHES_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (BRANCHNO) REFERENCES BRANCHES(BRANCHNO)
CAMPAIGN_WAVE_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_WAVE_SEQNO) REFERENCES CAMPAIGN_WAVE(SEQNO)
DF__JOBCOST_H__ALLOW__5828BB55DefaultColumn ConstraintALLOWANCE DEFAULT 0
DF__JOBCOST_H__ASSET__3E681DFBDefaultColumn ConstraintASSET_COST DEFAULT 0
DF__JOBCOST_H__ASSET__3F5C4234DefaultColumn ConstraintASSET_VALUE DEFAULT 0
DF__JOBCOST_H__BILLI__4C81FE7FDefaultColumn ConstraintBILLINGMODE DEFAULT 0
DF__JOBCOST_H__BRANC__46C859D2DefaultColumn ConstraintBRANCHNO DEFAULT 0
DF__JOBCOST_H__CALLB__7F179FEDDefaultColumn ConstraintCALLBACKDATE DEFAULT getdate()
DF__JOBCOST_H__CAMPA__0D717793DefaultColumn ConstraintCAMPAIGN_WAVE_SEQNO DEFAULT -1
DF__JOBCOST_H__CONTA__12899BBDDefaultColumn ConstraintCONTACTNO DEFAULT -1
DF__JOBCOST_H__COSTS__0FAD2F12DefaultColumn ConstraintCOSTSUBGL DEFAULT 0
DF__JOBCOST_H__DEF_O__09F455BCDefaultColumn ConstraintDEF_OVERHEAD DEFAULT 0
DF__JOBCOST_H__DEL_A__11957784DefaultColumn ConstraintDEL_ADDR DEFAULT -1
DF__JOBCOST_H__ENTRY__000BC426DefaultColumn ConstraintENTRYDATE DEFAULT getdate()
DF__JOBCOST_H__ESTIM__0BDC9E2EDefaultColumn ConstraintESTIMATECOST DEFAULT 0
DF__JOBCOST_H__EST_H__3D73F9C2DefaultColumn ConstraintEST_HOURS DEFAULT 0
DF__JOBCOST_H__EXCHR__5BB95517DefaultColumn ConstraintEXCHRATE DEFAULT 1
DF__JOBCOST_H__HASUN__48B0A244DefaultColumn ConstraintHASUNBILLED DEFAULT N
DF__JOBCOST_H__INVOI__0DC4E6A0DefaultColumn ConstraintINVOICEDCOST DEFAULT 0
DF__JOBCOST_H__INVOI__49A4C67DDefaultColumn ConstraintINVOICEREADY DEFAULT N
DF__JOBCOST_H__ISACT__47BC7E0BDefaultColumn ConstraintISACTIVE DEFAULT Y
DF__JOBCOST_H__LINEC__0A6AEDB6DefaultColumn ConstraintLINECHARGE_WRITEOFF DEFAULT 0
DF__JOBCOST_H__MASTE__0EB90AD9DefaultColumn ConstraintMASTER_JOBNO DEFAULT 0
DF__JOBCOST_H__MATER__0AE879F5DefaultColumn ConstraintMATERIALSCOST DEFAULT 0
DF__JOBCOST_H__OPPOR__74BAD862DefaultColumn ConstraintOPPORTUNITY_SEQNO DEFAULT -1
DF__JOBCOST_H__RETEN__104D18E7DefaultColumn ConstraintRETENTION2_RATE DEFAULT 0
DF__JOBCOST_H__RETEN__11413D20DefaultColumn ConstraintRETENTION2_MIN DEFAULT 0
DF__JOBCOST_H__RETEN__12356159DefaultColumn ConstraintRETENTION3_RATE DEFAULT 0
DF__JOBCOST_H__RETEN__13298592DefaultColumn ConstraintRETENTION3_MIN DEFAULT 0
DF__JOBCOST_H__RETEN__6542BF51DefaultColumn ConstraintRETENTION_RATE DEFAULT 0
DF__JOBCOST_H__SALES__10A1534BDefaultColumn ConstraintSALESSUBGL DEFAULT 0
DF__JOBCOST_H__THETI__0CD0C267DefaultColumn ConstraintTHETIMECOST DEFAULT 0
DF__JOBCOST_H__TOTAL__3C7FD589DefaultColumn ConstraintTOTAL_HOURS DEFAULT 0
DF__JOBCOST_H__WRITE__3B8BB150DefaultColumn ConstraintWRITE_OFF_COST DEFAULT 0
DR_ACCS_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (ACCNO) REFERENCES DR_ACCS(ACCNO)
GLACCS_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (COSTGL) REFERENCES GLACCS(ACCNO)
GLACCS_JOBCOST_HDR_SALESForeign KeyTable ConstraintFOREIGN KEY (SALESGL) REFERENCES GLACCS(ACCNO)
JOBCOST_PROJ_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (PROJ_SEQNO) REFERENCES JOBCOST_PROJ(SEQNO)
JOB_CATEGORIES_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (CATEGORY) REFERENCES JOB_CATEGORIES(CATNO)
JOB_STATUS_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (STATUS) REFERENCES JOB_STATUS(STATUSKEY)
JOB_TYPES_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (JOBTYPE) REFERENCES JOB_TYPES(TYPENO)
OPPORTUNITY_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (OPPORTUNITY_SEQNO) REFERENCES OPPORTUNITY(SEQNO)
PK__JOBCOST_HDR__09003183Primary KeyTable ConstraintPRIMARY KEY (JOBNO)
STAFF_JOBCOST_HDRForeign KeyTable ConstraintFOREIGN KEY (STAFFNO) REFERENCES STAFF(STAFFNO)
STAFF_JOBCOST_HDR_MGRForeign KeyTable ConstraintFOREIGN KEY (ACTIONBY) REFERENCES STAFF(STAFFNO)

Triggers:
Trigger nameCode
AFTER_JOBCOST_HDR_INSERTCREATE TRIGGER [dbo].[AFTER_JOBCOST_HDR_INSERT] ON [dbo].[JOBCOST_HDR]
FOR INSERT
AS
SET NOCOUNT ON
  DECLARE @JOBNO INTEGER
  DECLARE @MASTER_JOBNO INTEGER
  DECLARE @JOBCODE VARCHAR(15)
  SELECT
   @JOBNO=JOBNO,
   @JOBCODE=JOBCODE,
   @MASTER_JOBNO=MASTER_JOBNO
  FROM
    INSERTED
  IF @JOBCODE IS NULL
    UPDATE [dbo].[JOBCOST_HDR] SET JOBCODE = CAST(@JOBNO AS VARCHAR(15)) WHERE JOBNO=@JOBNO
  IF (@MASTER_JOBNO IS NULL) OR (@MASTER_JOBNO IN (-1, 0))
    UPDATE [dbo].[JOBCOST_HDR] SET MASTER_JOBNO = @JOBNO WHERE JOBNO=@JOBNO
SET NOCOUNT OFF
RETURN


Entity: JOBCOST_LINES
CommentThis table contains the details of all job quote lines.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the line.
QUOTE_QTYNoFLOAT(53)NoThe quantity on the quote.
QUOTE_UNITPRNoFLOAT(53)NoThe unit price on the line.
ACTUAL_UNITCOSTNoFLOAT(53)NoThe original unit cost on the line.
TRANSDATENoDATETIMENoThe transaction date on the line.
EXCHRATENoFLOAT(53)NoThe exchange rate applicable to the line.
DISCOUNTNoFLOAT(53)NoThe percentage discount on the line.
UNITPRICE_INCTAXNoFLOAT(53)NoThe unit price inclusive of tax.
JOBNONoINTEGERYesThe ID number of the job that this line is on.
SECTIONNoINTEGERNo
STOCKCODENoVARCHAR(23)NoThe stockcode of the stock item on this line.
DESCRIPTIONNoVARCHAR(60)NoThe description of the stock item on this line.
SHOW_ON_INVOICENoCHAR(1)No
COST_CENTRENoINTEGERNoThe ID number of the Cost Type on the line (from JOB_COSTTYPES).
LINE_STATUSNoVARCHAR(30)NoThe status on the job line. Will be one of:
Q = quote line
J = line has been committed and ready for invoice
I = line has been invoiced
P = line is a part of a Purchase Order
COST_CENTRE2NoINTEGERNoThe ID number of the Cost Group on the line (from JOB_COSTGROUPS).
LINE_SOURCENoVARCHAR(10)No
NARRATIVENoVARCHAR(1)No
TAXNONoINTEGERNoThe ID number of the tax rate on the line (from TAX_RATES).
BRANCHNONoINTEGERNoThe ID number of the branch that the line belongs to (from BRANCHES).
SUBCODENoINTEGERNoThe subcode of the P&L revenue account.
ANALYSISNoINTEGERNo
CURRENCYNONoINTEGERNoThe ID number of the currency on the line (from CURRENCIES).
ALINENONoINTEGERNoA rank ID that determines the order in which lines are displayed.
GLCODENoINTEGERNoThe GL account code of the P&L revenue account.
MASTER_JOBNONoINTEGERNoIf the line belongs to a sub-job, this field contains the ID of the master job.
COPY_FROM_QUOTENoCHAR(1)YesThe destination of quote lines. Will be one of:
T = Timesheets tab
P = Purchases tab
C = Costs tab
N = none
NARRATIVE_SEQNONoINTEGERNoThe ID number of the narrative on the line, if there is one (from NARRATIVES).
DIM_LENGTHNoFLOAT(53)YesDimension length.
DIM_WIDTHNoFLOAT(53)YesDimension width.
DIM_DEPTHNoFLOAT(53)YesDimension depth.
TOTAL_QUANTITYNoASNoThe total quantity after considering the dimensions (if applicable).
PRICE_OVERRIDDENNoCHAR(1)YesThis field contains 'Y' if the unit price or discount has been overridden.
BOMTYPENoCHAR(1)NoWill be one of:
N = Normal stock item
B = Build
K = Kit
L = Lookup item
BOMPRICINGNoCHAR(1)NoWill be one of:
N = normal
C = pricing by component (BOMs)
T= pricing by total (BOMs)
SHOWLINENoCHAR(1)NoUsed by reports to display/hide lines.
LINKEDSTATUSNoCHAR(1)NoS = Stocked, L = Lookup
LISTPRICENoFLOAT(53)NoThe list price of the stock item.
LINETYPENoINTEGERYesWill be one of:
0 = normal
1 = BOM header
2 = COM component
4 = comment line
KITSEQNONoINTEGERYesThe ID number of the Bill of Materials, if the stock line belongs to a one.
KITCODENoVARCHAR(23)NoThe ID code of the Bill of Materials, if the stock line belongs to a one (from BILLOMAT_HDR).
LINKED_STOCKCODENoVARCHAR(23)NoLinked stockcode.
LINKED_QTYNoFLOAT(53)NoQuantity (if the item is a linked stock item).
HIDDEN_COSTNoFLOAT(53)YesThis field applies to Bills of Materials. For kits that use pricing by components, this field stores header-level cost prices. For builds that use individual stock lines, this field stores the real cost.
HIDDEN_SELLNoFLOAT(53)YesThis field applies to Bills of Materials. For kits that use pricing by components, this field stores header-level sell prices. For builds that use individual stock lines, this field stores the sell price.
SUPPLIERNONoINTEGERNoID of the supplier (Creditor) for the stock item on this line (from CR_ACCS).
FROMLOCNoINTEGERNo
LINETOTALNoASNoTotal value of the stock line.
NUNITPRNoASNo
BATCHCODENoVARCHAR(20)NoThe batch code on the line, if there is one.
OPTION_NONoINTEGERYesThe ID number of the quote option assigned to the line.
X_LABOUR_ALLOWANCENoFLOAT(53)Yes
SPREADVALUENoCHAR(1)Yes
TAXRATENoFLOAT(53)YesThe tax rate percentage on the line.
LINETOTAL_TAXNoFLOAT(53)YesThe tax value on the line.
PREF_SERIALNONoVARCHAR(50)No
LINE_TAXNoFLOAT(53)Yes
HIDDEN_LINETOTALNoFLOAT(53)Yes
SCHEDULE_SEQNONoINTEGERYesID number of the Billing Schedule that applies to the line.
LINETOTAL_INCTAXNoASNoTotal value of the line, inclusive of tax.
JOBCOSTLINEIDNoINTEGERNoID of the job line.
SNTYPENoINTEGERNoSerial number type (applicable only if the item is serialised).
SNEXPDAYSNoINTEGERNoExpiry days (applicable only if the item is serialised).
OPPLINEIDNoINTEGERNoIf the job was created from an Opportunity in EXO CRM, this field contains the ID of the Opportunity line that this line was created from.
COST_LINENONoINTEGERYesThis field stores the COST_LINENO from DR_INVLINES/DR_INVLINES_PARK.

Relationships:
NameRelationship typeParentChildCardinality
BILLOMAT_HDR_JOBCOST_LINESNon IdentifyingBILLOMAT_HDRJOBCOST_LINESZero Or More
BRANCHES_JOBCOST_LINESNon IdentifyingBRANCHESJOBCOST_LINESZero Or More
CR_ACCS_JOBCOST_LINESNon IdentifyingCR_ACCSJOBCOST_LINESZero Or More
CURRENCIES_JOBCOST_LINESNon IdentifyingCURRENCIESJOBCOST_LINESZero Or More
GLACCS_JOBCOST_LINESNon IdentifyingGLACCSJOBCOST_LINESZero Or More
JOBCOST_HDR_JOBCOST_LINESNon IdentifyingJOBCOST_HDRJOBCOST_LINESZero Or More
JOBCOST_HDR_JOBCOST_LINES_MASTERNon IdentifyingJOBCOST_HDRJOBCOST_LINESZero Or More
JOBCOST_LINES_JOB_TRANSACTIONSNon IdentifyingJOBCOST_LINESJOB_TRANSACTIONSZero Or More
JOB_CONTRACT_BILLINGS_JOBCOST_LINESNon IdentifyingJOB_CONTRACT_BILLINGSJOBCOST_LINESZero Or More
JOB_COSTGROUPS_JOBCOST_LINESNon IdentifyingJOB_COSTGROUPSJOBCOST_LINESZero Or More
JOB_COSTTYPES_JOBCOST_LINESNon IdentifyingJOB_COSTTYPESJOBCOST_LINESZero Or More
JOB_QUOTE_OPTIONS_JOBCOST_LINESNon IdentifyingJOB_QUOTE_OPTIONSJOBCOST_LINESZero Or More
NARRATIVES_JOBCOST_LINESNon IdentifyingNARRATIVESJOBCOST_LINESZero Or More
STOCK_ITEMS_JOBCOST_LINESNon IdentifyingSTOCK_ITEMSJOBCOST_LINESZero Or More
STOCK_ITEMS_JOBCOST_LINES_DESCNon IdentifyingSTOCK_ITEMSJOBCOST_LINESZero Or More
TAX_RATES_JOBCOST_LINESNon IdentifyingTAX_RATESJOBCOST_LINESZero Or More

Indexes:
NameIndex columnsIndex type
SK_JC1JOBNO ASC
SK_JC2MASTER_JOBNO ASC
SK_JC3COPY_FROM_QUOTE ASC

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (COST_LINENO)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (SCHEDULE_SEQNO)
Not NullColumn ConstraintNOT NULL (HIDDEN_LINETOTAL)
Not NullColumn ConstraintNOT NULL (LINE_TAX)
Not NullColumn ConstraintNOT NULL (LINETOTAL_TAX)
Not NullColumn ConstraintNOT NULL (JOBNO)
Not NullColumn ConstraintNOT NULL (TAXRATE)
Not NullColumn ConstraintNOT NULL (SPREADVALUE)
Not NullColumn ConstraintNOT NULL (X_LABOUR_ALLOWANCE)
Not NullColumn ConstraintNOT NULL (OPTION_NO)
Not NullColumn ConstraintNOT NULL (HIDDEN_SELL)
Not NullColumn ConstraintNOT NULL (HIDDEN_COST)
Not NullColumn ConstraintNOT NULL (KITSEQNO)
Not NullColumn ConstraintNOT NULL (LINETYPE)
Not NullColumn ConstraintNOT NULL (PRICE_OVERRIDDEN)
Not NullColumn ConstraintNOT NULL (COPY_FROM_QUOTE)
Not NullColumn ConstraintNOT NULL (DIM_DEPTH)
Not NullColumn ConstraintNOT NULL (DIM_LENGTH)
Not NullColumn ConstraintNOT NULL (DIM_WIDTH)
BILLOMAT_HDR_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (KITCODE) REFERENCES BILLOMAT_HDR(BILLCODE)
BRANCHES_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (BRANCHNO) REFERENCES BRANCHES(BRANCHNO)
CR_ACCS_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (SUPPLIERNO) REFERENCES CR_ACCS(ACCNO)
CURRENCIES_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (CURRENCYNO) REFERENCES CURRENCIES(CURRENCYNO)
DF__JOBCOST_L__ALINE__1EEF72A2DefaultColumn ConstraintALINENO DEFAULT 0
DF__JOBCOST_L__ANALY__1D072A30DefaultColumn ConstraintANALYSIS DEFAULT 0
DF__JOBCOST_L__BOMPR__686944BFDefaultColumn ConstraintBOMPRICING DEFAULT N
DF__JOBCOST_L__BOMTY__67752086DefaultColumn ConstraintBOMTYPE DEFAULT N
DF__JOBCOST_L__BRANC__1B1EE1BEDefaultColumn ConstraintBRANCHNO DEFAULT 0
DF__JOBCOST_L__COPY___3019FEA4DefaultColumn ConstraintCOPY_FROM_QUOTE DEFAULT N
DF__JOBCOST_L__COST___790B578ADefaultColumn ConstraintCOST_LINENO DEFAULT -1
DF__JOBCOST_L__CURRE__1DFB4E69DefaultColumn ConstraintCURRENCYNO DEFAULT 0
DF__JOBCOST_L__DIM_D__3D3EEF98DefaultColumn ConstraintDIM_DEPTH DEFAULT 1
DF__JOBCOST_L__DIM_L__3B56A726DefaultColumn ConstraintDIM_LENGTH DEFAULT 1
DF__JOBCOST_L__DIM_W__3C4ACB5FDefaultColumn ConstraintDIM_WIDTH DEFAULT 1
DF__JOBCOST_L__DISCO__174E50DADefaultColumn ConstraintDISCOUNT DEFAULT 0
DF__JOBCOST_L__EXCHR__165A2CA1DefaultColumn ConstraintEXCHRATE DEFAULT 0
DF__JOBCOST_L__FROML__7E237BB4DefaultColumn ConstraintFROMLOC DEFAULT 0
DF__JOBCOST_L__GLCOD__1FE396DBDefaultColumn ConstraintGLCODE DEFAULT 0
DF__JOBCOST_L__HIDDE__635A76DFDefaultColumn ConstraintHIDDEN_LINETOTAL DEFAULT 0
DF__JOBCOST_L__HIDDE__7B470F09DefaultColumn ConstraintHIDDEN_COST DEFAULT 0
DF__JOBCOST_L__HIDDE__7C3B3342DefaultColumn ConstraintHIDDEN_SELL DEFAULT 0
DF__JOBCOST_L__KITSE__795EC697DefaultColumn ConstraintKITSEQNO DEFAULT -1
DF__JOBCOST_L__LINET__5F89E5FBDefaultColumn ConstraintLINETOTAL_TAX DEFAULT 0
DF__JOBCOST_L__LINET__786AA25EDefaultColumn ConstraintLINETYPE DEFAULT -1
DF__JOBCOST_L__LINE___61722E6DDefaultColumn ConstraintLINE_TAX DEFAULT 0
DF__JOBCOST_L__LINKE__6A518D31DefaultColumn ConstraintLINKEDSTATUS DEFAULT N
DF__JOBCOST_L__LINKE__7A52EAD0DefaultColumn ConstraintLINKED_QTY DEFAULT 0
DF__JOBCOST_L__MASTE__20D7BB14DefaultColumn ConstraintMASTER_JOBNO DEFAULT 0
DF__JOBCOST_L__NARRA__1936994CDefaultColumn ConstraintNARRATIVE DEFAULT N
DF__JOBCOST_L__OPPLI__0E659BCCDefaultColumn ConstraintOPPLINEID DEFAULT -1
DF__JOBCOST_L__OPTIO__57E8C433DefaultColumn ConstraintOPTION_NO DEFAULT 0
DF__JOBCOST_L__PRICE__1F798287DefaultColumn ConstraintPRICE_OVERRIDDEN DEFAULT N
DF__JOBCOST_L__SCHED__40313633DefaultColumn ConstraintSCHEDULE_SEQNO DEFAULT 0
DF__JOBCOST_L__SHOWL__695D68F8DefaultColumn ConstraintSHOWLINE DEFAULT Y
DF__JOBCOST_L__SNEXP__016AC80ADefaultColumn ConstraintSNEXPDAYS DEFAULT -1
DF__JOBCOST_L__SNTYP__7F827F98DefaultColumn ConstraintSNTYPE DEFAULT -1
DF__JOBCOST_L__SPREA__59D10CA5DefaultColumn ConstraintSPREADVALUE DEFAULT Y
DF__JOBCOST_L__SUBCO__1C1305F7DefaultColumn ConstraintSUBCODE DEFAULT 0
DF__JOBCOST_L__SUPPL__7D2F577BDefaultColumn ConstraintSUPPLIERNO DEFAULT 0
DF__JOBCOST_L__TAXNO__1A2ABD85DefaultColumn ConstraintTAXNO DEFAULT 0
DF__JOBCOST_L__TAXRA__5DA19D89DefaultColumn ConstraintTAXRATE DEFAULT 0
DF__JOBCOST_L__TRANS__15660868DefaultColumn ConstraintTRANSDATE DEFAULT getdate()
DF__JOBCOST_L__UNITP__18427513DefaultColumn ConstraintUNITPRICE_INCTAX DEFAULT 0
DF__JOBCOST_L__X_LAB__58DCE86CDefaultColumn ConstraintX_LABOUR_ALLOWANCE DEFAULT 0
GLACCS_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (GLCODE) REFERENCES GLACCS(ACCNO)
JOBCOST_HDR_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOBCOST_HDR_JOBCOST_LINES_MASTERForeign KeyTable ConstraintFOREIGN KEY (MASTER_JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOB_CONTRACT_BILLINGS_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (SCHEDULE_SEQNO) REFERENCES JOB_CONTRACT_BILLINGS(SEQNO)
JOB_COSTGROUPS_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (COST_CENTRE2) REFERENCES JOB_COSTGROUPS(SEQNO)
JOB_COSTTYPES_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (COST_CENTRE) REFERENCES JOB_COSTTYPES(SEQNO)
JOB_QUOTE_OPTIONS_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (OPTION_NO) REFERENCES JOB_QUOTE_OPTIONS(SEQNO)
NARRATIVES_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (NARRATIVE_SEQNO) REFERENCES NARRATIVES(SEQNO)
PK__JOBCOST_LINES__1471E42FPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
STOCK_ITEMS_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)
STOCK_ITEMS_JOBCOST_LINES_DESCForeign KeyTable ConstraintFOREIGN KEY (DESCRIPTION) REFERENCES STOCK_ITEMS(DESCRIPTION)
TAX_RATES_JOBCOST_LINESForeign KeyTable ConstraintFOREIGN KEY (TAXNO) REFERENCES TAX_RATES(SEQNO)



Entity: JOBCOST_PROJ
CommentThis table contains details of the projects that jobs can be grouped under.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the project.
PROJ_CODENoVARCHAR(15)YesAn alphanumerical ID code for the project.
PROJ_TITLENoVARCHAR(60)NoA descriptive title for the project.
ISACTIVENoCHAR(1)YesThis field contains 'Y' if the project is currently active.
DESCRIPTIONNoTEXTNoDescriptive text for the project.

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_PROJ_JOBCOST_HDRNon IdentifyingJOBCOST_PROJJOBCOST_HDRZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (PROJ_CODE)
DF__JOBCOST_P__ISACT__053B58EEDefaultColumn ConstraintISACTIVE DEFAULT Y
PK__JOBCOST_PROJ__044734B5Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOBCOST_RESOURCE
CommentThis table contains details of all job resources.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the resource.
COSTRATE0NoFLOAT(53)No
COSTRATE1NoFLOAT(53)No
COSTRATE2NoFLOAT(53)No
COSTRATE3NoFLOAT(53)No
SELLRATE0NoFLOAT(53)No
SELLRATE1NoFLOAT(53)No
SELLRATE2NoFLOAT(53)No
SELLRATE3NoFLOAT(53)No
REVIEWDATENoDATETIMENo
NORMALHOURSNoFLOAT(53)No
STAFFNONoINTEGERNoIf the resource relates to an EXO Business staff member, their ID number is recorded here.
RESOURCENAMENoVARCHAR(30)YesThe resource's name.
TITLENoVARCHAR(30)NoThe resource's title.
ISACTIVENoCHAR(1)YesThis field contains 'Y' if the resource is currently active.
DEFAULT_STOCKCODENoVARCHAR(23)NoIf the resource has a default stockcode, it is recorded here.
SHORTCODENoVARCHAR(3)NoA short (max. three characters) ID code for the resource.
EMAIL_ADDRESSNoVARCHAR(40)No
FILTERSQLNoVARCHAR(100)NoIf the resource uses a SQL statement to filter stock item searches for times, it is recorded here.

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_RESOURCE_JOB_RESOURCE_ALLOCATIONNon IdentifyingJOBCOST_RESOURCEJOB_RESOURCE_ALLOCATIONZero Or More
STAFF_JOBCOST_RESOURCENon IdentifyingSTAFFJOBCOST_RESOURCEZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (RESOURCENAME)
DF__JOBCOST_R__COSTR__23B427BFDefaultColumn ConstraintCOSTRATE0 DEFAULT 0
DF__JOBCOST_R__COSTR__24A84BF8DefaultColumn ConstraintCOSTRATE1 DEFAULT 0
DF__JOBCOST_R__COSTR__259C7031DefaultColumn ConstraintCOSTRATE2 DEFAULT 0
DF__JOBCOST_R__COSTR__2690946ADefaultColumn ConstraintCOSTRATE3 DEFAULT 0
DF__JOBCOST_R__ISACT__2C496DC0DefaultColumn ConstraintISACTIVE DEFAULT Y
DF__JOBCOST_R__NORMA__2B554987DefaultColumn ConstraintNORMALHOURS DEFAULT 0
DF__JOBCOST_R__SELLR__2784B8A3DefaultColumn ConstraintSELLRATE0 DEFAULT 0
DF__JOBCOST_R__SELLR__2878DCDCDefaultColumn ConstraintSELLRATE1 DEFAULT 0
DF__JOBCOST_R__SELLR__296D0115DefaultColumn ConstraintSELLRATE2 DEFAULT 0
DF__JOBCOST_R__SELLR__2A61254EDefaultColumn ConstraintSELLRATE3 DEFAULT 0
PK__JOBCOST_RESOURCE__22C00386Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_JOBCOST_RESOURCEForeign KeyTable ConstraintFOREIGN KEY (STAFFNO) REFERENCES STAFF(STAFFNO)



Entity: JOB_CATEGORIES
CommentThis table contains details of all Job Categories.
Primary key columnsCATNO

Attributes:
Column namePrimary keyData typeNot NULLComment
CATNOYesINTEGERYesA unique ID number for the Job Category.
CATDESCNoVARCHAR(40)NoA descriptive name for the category.
DISP_COLOURNoVARCHAR(15)NoNot used.
SHORTCODENoVARCHAR(3)NoA short (max. three characters) ID code for the category.
GANTTBAR_COLOURNoINTEGERNoA colour code that determines how jobs of this category should appear on the diagram on the Job Overview tab.

Relationships:
NameRelationship typeParentChildCardinality
JOB_CATEGORIES_JOBCOST_HDRNon IdentifyingJOB_CATEGORIESJOBCOST_HDRZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (CATNO)
PK__JOB_CATEGORIES__62DA889BPrimary KeyTable ConstraintPRIMARY KEY (CATNO)



Entity: JOB_CONTRACT_BILLINGS
CommentThis table contains details of Progress Billing records on jobs.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the billing record.
JOBNONoINTEGERNoThe ID number of the job that the billing record is attached to.
DESCRIPTIONNoVARCHAR(60)YesA descriptive name for the billing record.
DUE_DATENoDATETIMENoThe date that this billing entry is due on.
SUBTOTALNoFLOAT(53)NoThe subtotal on the billing record.
TAXTOTALNoFLOAT(53)NoThe total tax amount on the billing record.
RETENTIONNoFLOAT(53)NoThe base retention percentage for the line.
RETENTION_RATENoFLOAT(53)NoThe base retention rate for the line.
INV_SEQNONoINTEGERNoIf the line has been invoiced, this field contains the ID number (SEQNO) of the invoice in the DR_TRANS table.
INVNONoVARCHAR(20)NoIf the line has been invoiced, this field contains the invoice number for the invoice.
MASTER_JOBNONoINTEGERYesIf the job is a sub-job, this field contains the ID number of the master job.
CURRENCYNONoINTEGERYesThis field displays the ID number of the currency that the billing record is in.
EXCHRATENoFLOAT(53)YesThe exchange rate for the line at the time of the transaction.
RETENTION_DUE_DATENoDATETIMENoThe retention due date.
PROFORMA_NONoVARCHAR(20)No
RETENTION_INV_SEQNONoINTEGERYes
RETENTION_INVNONoVARCHAR(20)No
ALLOW_ALLOCATIONNoCHAR(1)Yes
RETENTION2NoFLOAT(53)YesThe Retention 2 rate for the line.
RETENTION2_RATENoFLOAT(53)YesThe Retention 2 percentage for the line.
RETENTION3NoFLOAT(53)YesThe Retention 3 rate for the line.
RETENTION3_RATENoFLOAT(53)YesThe Retention 3 percentage for the line.
GLCODENoINTEGERYesThe ID number of the GL account for this line.
GLSUBCODENoINTEGERYesThe ID number of the GL sub-account for this line.
RETENTION_REALISEDNoFLOAT(53)YesThe retention amount realised on the line.
PERCENTAGE_COMPLETENoFLOAT(53)YesThe Percentage Complete amount for the line.
STOCKCODENoVARCHAR(23)NoThe stockcode for the billing record.
NARRATIVE_SEQNONoINTEGERNoThe ID number of the narrative on the line, if there is one.
INVOICEDNoCHAR(1)YesThis field contains 'Y' if the line has been invoiced.
ALLOCATED_COSTSNoFLOAT(53)YesThe Allocated Costs amount on the line.

Relationships:
NameRelationship typeParentChildCardinality
CURRENCIES_JOB_CONTRACT_BILLINGSNon IdentifyingCURRENCIESJOB_CONTRACT_BILLINGSZero Or More
GLACCS_JOB_CONTRACT_BILLINGSNon IdentifyingGLACCSJOB_CONTRACT_BILLINGSZero Or More
GLACCS_JOB_CONTRACT_BILLINGS_SUBNon IdentifyingGLACCSJOB_CONTRACT_BILLINGSZero Or More
JOBCOST_HDR_JOB_CONTRACT_BILLINGSNon IdentifyingJOBCOST_HDRJOB_CONTRACT_BILLINGSZero Or More
JOBCOST_HDR_JOB_CONTRACT_BILLINGS_MASTERNon IdentifyingJOBCOST_HDRJOB_CONTRACT_BILLINGSZero Or More
JOB_CONTRACT_BILLINGS_JOBCOST_LINESNon IdentifyingJOB_CONTRACT_BILLINGSJOBCOST_LINESZero Or More
JOB_CONTRACT_BILLINGS_JOB_TRANSACTIONSNon IdentifyingJOB_CONTRACT_BILLINGSJOB_TRANSACTIONSZero Or More
NARRATIVES_JOB_CONTRACT_BILLINGSNon IdentifyingNARRATIVESJOB_CONTRACT_BILLINGSZero Or More
STOCK_ITEMS_JOB_CONTRACT_BILLINGSNon IdentifyingSTOCK_ITEMSJOB_CONTRACT_BILLINGSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ALLOCATED_COSTS)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (INVOICED)
Not NullColumn ConstraintNOT NULL (DESCRIPTION)
Not NullColumn ConstraintNOT NULL (MASTER_JOBNO)
Not NullColumn ConstraintNOT NULL (PERCENTAGE_COMPLETE)
Not NullColumn ConstraintNOT NULL (CURRENCYNO)
Not NullColumn ConstraintNOT NULL (RETENTION_REALISED)
Not NullColumn ConstraintNOT NULL (EXCHRATE)
Not NullColumn ConstraintNOT NULL (GLSUBCODE)
Not NullColumn ConstraintNOT NULL (RETENTION_INV_SEQNO)
Not NullColumn ConstraintNOT NULL (GLCODE)
Not NullColumn ConstraintNOT NULL (ALLOW_ALLOCATION)
Not NullColumn ConstraintNOT NULL (RETENTION3_RATE)
Not NullColumn ConstraintNOT NULL (RETENTION2)
Not NullColumn ConstraintNOT NULL (RETENTION3)
Not NullColumn ConstraintNOT NULL (RETENTION2_RATE)
CURRENCIES_JOB_CONTRACT_BILLINGSForeign KeyTable ConstraintFOREIGN KEY (CURRENCYNO) REFERENCES CURRENCIES(CURRENCYNO)
DF__JOB_CONTR__ALLOC__069A5CD2DefaultColumn ConstraintALLOCATED_COSTS DEFAULT 0
DF__JOB_CONTR__ALLOW__3F3D11FADefaultColumn ConstraintALLOW_ALLOCATION DEFAULT Y
DF__JOB_CONTR__CURRE__3C60A54FDefaultColumn ConstraintCURRENCYNO DEFAULT 0
DF__JOB_CONTR__EXCHR__3D54C988DefaultColumn ConstraintEXCHRATE DEFAULT 1
DF__JOB_CONTR__GLCOD__2E9C95DDDefaultColumn ConstraintGLCODE DEFAULT 0
DF__JOB_CONTR__GLSUB__2F90BA16DefaultColumn ConstraintGLSUBCODE DEFAULT 0
DF__JOB_CONTR__INVOI__05A63899DefaultColumn ConstraintINVOICED DEFAULT N
DF__JOB_CONTR__JOBNO__681F2BFCDefaultColumn ConstraintJOBNO DEFAULT 0
DF__JOB_CONTR__MASTE__3B6C8116DefaultColumn ConstraintMASTER_JOBNO DEFAULT 0
DF__JOB_CONTR__PERCE__48275DB6DefaultColumn ConstraintPERCENTAGE_COMPLETE DEFAULT 0
DF__JOB_CONTR__RETEN__1605F23DDefaultColumn ConstraintRETENTION2 DEFAULT 0
DF__JOB_CONTR__RETEN__16FA1676DefaultColumn ConstraintRETENTION2_RATE DEFAULT 0
DF__JOB_CONTR__RETEN__17EE3AAFDefaultColumn ConstraintRETENTION3 DEFAULT 0
DF__JOB_CONTR__RETEN__18E25EE8DefaultColumn ConstraintRETENTION3_RATE DEFAULT 0
DF__JOB_CONTR__RETEN__3084DE4FDefaultColumn ConstraintRETENTION_REALISED DEFAULT 0
DF__JOB_CONTR__RETEN__3E48EDC1DefaultColumn ConstraintRETENTION_INV_SEQNO DEFAULT 0
GLACCS_JOB_CONTRACT_BILLINGSForeign KeyTable ConstraintFOREIGN KEY (GLCODE) REFERENCES GLACCS(ACCNO)
GLACCS_JOB_CONTRACT_BILLINGS_SUBForeign KeyTable ConstraintFOREIGN KEY (GLSUBCODE) REFERENCES GLACCS(ACCNO)
JOBCOST_HDR_JOB_CONTRACT_BILLINGSForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOBCOST_HDR_JOB_CONTRACT_BILLINGS_MASTERForeign KeyTable ConstraintFOREIGN KEY (MASTER_JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
NARRATIVES_JOB_CONTRACT_BILLINGSForeign KeyTable ConstraintFOREIGN KEY (NARRATIVE_SEQNO) REFERENCES NARRATIVES(SEQNO)
PK__JOB_CONTRACT_BIL__672B07C3Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STOCK_ITEMS_JOB_CONTRACT_BILLINGSForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)



Entity: JOB_COSTGROUPS
CommentThis table records details of the Job Cost Groups.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Cost Group.
DEF_MARKUPNoFLOAT(53)NoThe default markup on the group.
DEF_OVERHEADNoFLOAT(53)NoThe default overhead on the group.
COSTDESCNoVARCHAR(50)NoA descriptive name for the group.
SHORTCODENoVARCHAR(3)NoA short (max. three characters) code for the group.
SHOWONQUOTENoCHAR(1)NoThis field contains 'T' if the group's "Show on quote" option is ticked; otherwise 'F'.
CONSOLIDATENoCHAR(1)NoThis field contains 'T' if the group's "Consolidate" option is ticked; otherwise 'F'.
COPY_FROM_QUOTENoCHAR(1)NoThis field indicates what the group's "Copy from quote to:" option is set to. Will be one of:
N = None
C = Costs
T = Timesheet
P = Purchase

Relationships:
NameRelationship typeParentChildCardinality
JOB_COSTGROUPS_INWARDS_GOODS_LINESNon IdentifyingJOB_COSTGROUPSINWARDS_GOODS_LINESZero Or More
JOB_COSTGROUPS_JOBCOST_LINESNon IdentifyingJOB_COSTGROUPSJOBCOST_LINESZero Or More
JOB_COSTGROUPS_JOB_COSTTYPESNon IdentifyingJOB_COSTGROUPSJOB_COSTTYPESZero Or More
JOB_COSTGROUPS_JOB_TRANSACTIONSNon IdentifyingJOB_COSTGROUPSJOB_TRANSACTIONSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
DF__JOB_COSTG__CONSO__6D58170EDefaultColumn ConstraintCONSOLIDATE DEFAULT F
DF__JOB_COSTG__COPY___6E4C3B47DefaultColumn ConstraintCOPY_FROM_QUOTE DEFAULT F
DF__JOB_COSTG__SHOWO__6C63F2D5DefaultColumn ConstraintSHOWONQUOTE DEFAULT F
PK__JOB_COSTGROUPS__6B6FCE9CPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_COSTTYPES
CommentThis table records details of the Job Cost Types
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Cost Type.
DEF_MARKUPNoFLOAT(53)NoThe default markup percentage for the type.
DEF_OVERHEADNoFLOAT(53)NoThe default overhead percentage for the type.
COSTDESCNoVARCHAR(50)NoA descriptive name for the type.
GLCODENoINTEGERNoThe General Ledger code for the Sales Account related to this type.
GLSUBCODENoINTEGERNoThe General Ledger sub-account code for the Sales Account related to this type.
SHOWONQUOTENoCHAR(1)NoThis field contains 'T' if the type's "Show on quote" option is ticked; otherwise 'F'.
SHORTCODENoVARCHAR(3)YesA short (max. three characters) code for the type
DEF_COSTGROUPNoINTEGERNoThe ID number of the Cost Group that this type belongs to.
DEF_PURCH_GLCODENoINTEGERNoThe General Ledger code for the Purchasing Account related to this type.
DEF_PURCH_GLSUBCODENoINTEGERNoThe General Ledger sub-account code for the Purchasing Account related to this type.
CONSOLIDATENoCHAR(1)NoThis field contains 'T' if the type's "Consolidate" option is ticked; otherwise 'F'.
COPY_FROM_QUOTENoCHAR(1)NoThis field indicates what the group's "Copy from quote to:" option is set to. Will be one of:
N = None
C = Costs
T = Timesheet
P = Purchase

Relationships:
NameRelationship typeParentChildCardinality
JOB_COSTGROUPS_JOB_COSTTYPESNon IdentifyingJOB_COSTGROUPSJOB_COSTTYPESZero Or More
JOB_COSTTYPES_INWARDS_GOODS_LINESNon IdentifyingJOB_COSTTYPESINWARDS_GOODS_LINESZero Or More
JOB_COSTTYPES_JOBCOST_LINESNon IdentifyingJOB_COSTTYPESJOBCOST_LINESZero Or More
JOB_COSTTYPES_JOB_TRANSACTIONSNon IdentifyingJOB_COSTTYPESJOB_TRANSACTIONSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SHORTCODE)
Not NullColumn ConstraintNOT NULL (SEQNO)
DF__JOB_COSTT__CONSO__689361F1DefaultColumn ConstraintCONSOLIDATE DEFAULT F
DF__JOB_COSTT__COPY___6987862ADefaultColumn ConstraintCOPY_FROM_QUOTE DEFAULT F
DF__JOB_COSTT__GLSUB__66AB197FDefaultColumn ConstraintGLSUBCODE DEFAULT 0
DF__JOB_COSTT__SHOWO__679F3DB8DefaultColumn ConstraintSHOWONQUOTE DEFAULT F
JOB_COSTGROUPS_JOB_COSTTYPESForeign KeyTable ConstraintFOREIGN KEY (DEF_COSTGROUP) REFERENCES JOB_COSTGROUPS(SEQNO)
PK__JOB_COSTTYPES__65B6F546Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_HIST
CommentThis table contains details of the History Notes attached to jobs.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the History Note.
JOBNONoINTEGERNoThe ID number of the job that the History Note is attached to.
SUBJECTNoVARCHAR(80)NoThe History Note's subject line.
NOTENoVARCHAR(4096)NoThe text of the History Note.
POSTTIMENoDATETIMENoThe actual date and time that the record was posted.
TRANSDATENoDATETIMENoThe transaction date against the History Note.
SALESNONoINTEGERNoThe ID number of the EXO Business staff member who added the History Note.
OUTLOOK_LINKNoVARCHAR(40)NoIf the History Note was emailed, this field contains a link to the email in MS Outlook.

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_HDR_JOB_HISTNon IdentifyingJOBCOST_HDRJOB_HISTZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
DF__JOB_HIST__POSTTI__4B03CA61DefaultColumn ConstraintPOSTTIME DEFAULT getdate()
DF__JOB_HIST__TRANSD__4BF7EE9ADefaultColumn ConstraintTRANSDATE DEFAULT getdate()
JOBCOST_HDR_JOB_HISTForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
PK__JOB_HIST__4A0FA628Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_OTHER_REPORTS
CommentThis is a legacy table that is no longer used.
Primary key columnsREPORTNO

Attributes:
Column namePrimary keyData typeNot NULLComment
REPORTNOYesINTEGERYesNo longer used.
REPORTDESCNoVARCHAR(40)NoNo longer used.
REPORT_PARAMSNoVARCHAR(200)NoNo longer used.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (REPORTNO)
PK__JOB_OTHER_REPORT__703483B9Primary KeyTable ConstraintPRIMARY KEY (REPORTNO)



Entity: JOB_OUTPUT_ITEMS
CommentThis table records details of any items specified on the Output Items sub-tab of a job.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the item.
JOBNONoINTEGERNoThe ID number of the job that the item belongs to.
STOCKCODENoVARCHAR(23)YesThe stockcode of the output stock item.
DESCRIPTIONNoVARCHAR(60)YesThe description of the output stock item.
LOCATIONNoINTEGERNoThe location specified for the output item (from STOCK_LOCATIONS).
QUANTITYNoFLOAT(53)NoThe quantity of the item that will be produced.

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_HDR_JOB_OUTPUT_ITEMSNon IdentifyingJOBCOST_HDRJOB_OUTPUT_ITEMSZero Or More
STOCK_ITEMS_JOB_OUTPUT_ITEMSNon IdentifyingSTOCK_ITEMSJOB_OUTPUT_ITEMSZero Or More
STOCK_ITEMS_JOB_OUTPUT_ITEMS_DESCNon IdentifyingSTOCK_ITEMSJOB_OUTPUT_ITEMSZero Or More
STOCK_LOCATIONS_JOB_OUTPUT_ITEMSNon IdentifyingSTOCK_LOCATIONSJOB_OUTPUT_ITEMSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (DESCRIPTION)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (STOCKCODE)
DF__JOB_OUTPU__JOBNO__032827F3DefaultColumn ConstraintJOBNO DEFAULT 0
JOBCOST_HDR_JOB_OUTPUT_ITEMSForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
PK__JOB_OUTPUT_ITEMS__023403BAPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
STOCK_ITEMS_JOB_OUTPUT_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)
STOCK_ITEMS_JOB_OUTPUT_ITEMS_DESCForeign KeyTable ConstraintFOREIGN KEY (DESCRIPTION) REFERENCES STOCK_ITEMS(DESCRIPTION)
STOCK_LOCATIONS_JOB_OUTPUT_ITEMSForeign KeyTable ConstraintFOREIGN KEY (LOCATION) REFERENCES STOCK_LOCATIONS(LOCNO)



Entity: JOB_QUOTE_OPTIONS
CommentThis table records details of the Quote Options available for job quotes.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Quote Option.
JOBNONoINTEGERNoThe ID number of the job that this option applies to.
OPTION_NONoINTEGERNoA job-specific ID number for the option.
OPTION_NAMENoVARCHAR(30)NoThe option's name.
OPTION_SELECTEDNoCHAR(1)YesThis field contains 'Y' if the option is currently selected for the job.

Relationships:
NameRelationship typeParentChildCardinality
JOB_QUOTE_OPTIONS_JOBCOST_LINESNon IdentifyingJOB_QUOTE_OPTIONSJOBCOST_LINESZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (OPTION_SELECTED)
Not NullColumn ConstraintNOT NULL (SEQNO)
DF__JOB_QUOTE__JOBNO__550C5788DefaultColumn ConstraintJOBNO DEFAULT 0
DF__JOB_QUOTE__OPTIO__56007BC1DefaultColumn ConstraintOPTION_NO DEFAULT 0
DF__JOB_QUOTE__OPTIO__56F49FFADefaultColumn ConstraintOPTION_SELECTED DEFAULT N
PK__JOB_QUOTE_OPTION__5418334FPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_RESOURCE_ALLOCATION
CommentThis table records all allocations of resources to jobs.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the allocation.
RESOURCE_SEQNONoINTEGERYesThe ID number of the resource being allocated.
JOBNONoINTEGERYesThe ID number of the job that the resource is allocated to.
SUBJECT_NOTESNoVARCHAR(255)NoAny notes entered into the allocation's Subject field.
LOCATIONNoINTEGERNoThe Location code entered for the allocation.
START_DATENoDATETIMENoThe allocation's start date.
START_TIMENoDATETIMENoThe allocation's start time.
END_DATENoDATETIMENoThe allocation's end date.
END_TIMENoDATETIMENoThe allocation's end time.
TOTAL_HOURSNoFLOAT(53)NoThe total number of hours that the resource was allocated for.
APPOINTMENT_SCHEDULEDNoCHAR(1)YesThis field contains 'Y' if an appointment has been scheduled for the allocation.

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_HDR_JOB_RESOURCE_ALLOCATIONNon IdentifyingJOBCOST_HDRJOB_RESOURCE_ALLOCATIONZero Or More
JOBCOST_RESOURCE_JOB_RESOURCE_ALLOCATIONNon IdentifyingJOBCOST_RESOURCEJOB_RESOURCE_ALLOCATIONZero Or More
JOB_RESOURCE_ALLOCATION_TASKSNon IdentifyingJOB_RESOURCE_ALLOCATIONTASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (APPOINTMENT_SCHEDULED)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (RESOURCE_SEQNO)
Not NullColumn ConstraintNOT NULL (JOBNO)
DF__JOB_RESOU__APPOI__1F846F7FDefaultColumn ConstraintAPPOINTMENT_SCHEDULED DEFAULT N
JOBCOST_HDR_JOB_RESOURCE_ALLOCATIONForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOBCOST_RESOURCE_JOB_RESOURCE_ALLOCATIONForeign KeyTable ConstraintFOREIGN KEY (RESOURCE_SEQNO) REFERENCES JOBCOST_RESOURCE(SEQNO)
PK__JOB_RESOURCE_ALL__1E904B46Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_RETENTION_LEVELS
CommentThis table records the default retention levels used by EXO Job Costing.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number of the line.
RTN_2_MINNoFLOAT(53)NoThe Minimum Value for the Level 2 Retention.
RTN_2_RATENoFLOAT(53)NoThe % Rate for the Level 2 Retention.
RTN_3_MINNoFLOAT(53)NoThe Minimum Value for the Level 3 Retention.
RTN_3_RATENoFLOAT(53)NoThe % Rate for the Level 3 Retention.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__JOB_RETENTION_LE__1ACAA75APrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_STATUS
CommentThis table contains details of Job Statuses.
Primary key columnsSTATUSKEY

Attributes:
Column namePrimary keyData typeNot NULLComment
STATUSKEYYesVARCHAR(1)YesA unique one letter ID code for the Job Status.
STATUSDESCNoVARCHAR(30)YesA descriptive name for the status.
ADMIN_STATNoVARCHAR(1)NoIf this field contains 'Y', the status prevents entry of new transactions.
LOCK_JOBNoVARCHAR(1)NoIf this field contains 'Y', the status makes the job read-only.
ISARCHIVEDNoCHAR(1)YesIf this field contains 'Y', the status causes the job to be archived.
ISCOMPLETENoCHAR(1)YesIf this field contains 'Y', the status causes the job to be marked as Complete.
ISACTIVENoCHAR(1)YesIf this field contains 'Y', the status causes the job to be marked as Active.
ISINVOICEREADYNoCHAR(1)YesIf this field contains 'Y', the status causes the job to be marked as Ready for Invoice.
ISLOCKQUOTENoCHAR(1)YesIf this field contains 'Y', the status causes quotations on the job to be read-only.
WORKFLOW_CONSTRAINEDNoCHAR(1)YesIf this field contains 'Y', workflow constraints (defined in the JOB_STATUS_CONSTRAINT table) apply to the status.
GANTTBAR_COLOURNoINTEGERNoA colour code that determines how jobs of this status should appear on the diagram on the Job Overview tab.

Relationships:
NameRelationship typeParentChildCardinality
JOB_STATUS_JOBCOST_HDRNon IdentifyingJOB_STATUSJOBCOST_HDRZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (WORKFLOW_CONSTRAINED)
Not NullColumn ConstraintNOT NULL (STATUSKEY)
Not NullColumn ConstraintNOT NULL (STATUSDESC)
Not NullColumn ConstraintNOT NULL (ISLOCKQUOTE)
Not NullColumn ConstraintNOT NULL (ISARCHIVED)
Not NullColumn ConstraintNOT NULL (ISINVOICEREADY)
Not NullColumn ConstraintNOT NULL (ISCOMPLETE)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
DF__JOB_STATU__ISACT__02E830D1DefaultColumn ConstraintISACTIVE DEFAULT N
DF__JOB_STATU__ISARC__00FFE85FDefaultColumn ConstraintISARCHIVED DEFAULT N
DF__JOB_STATU__ISCOM__01F40C98DefaultColumn ConstraintISCOMPLETE DEFAULT N
DF__JOB_STATU__ISINV__03DC550ADefaultColumn ConstraintISINVOICEREADY DEFAULT N
DF__JOB_STATU__ISLOC__04D07943DefaultColumn ConstraintISLOCKQUOTE DEFAULT N
DF__JOB_STATU__LOCK___052FA09FDefaultColumn ConstraintLOCK_JOB DEFAULT N
DF__JOB_STATU__WORKF__3A785CDDDefaultColumn ConstraintWORKFLOW_CONSTRAINED DEFAULT N
PK__JOB_STATUS__043B7C66Primary KeyTable ConstraintPRIMARY KEY (STATUSKEY)



Entity: JOB_STATUS_CONSTRAINT
CommentThis table contains details of job workflow constraints.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the workflow constraint.
ISACTIVENoCHAR(1)YesIf this field contains 'Y', the constraint applies, so that users are permitted to change a job from the stage specified by the FROM_STATUS to the stage specified by the TO_STATUS.
FROM_STATUSNoCHAR(1)NoThe source stage for the constraint.
TO_STATUSNoCHAR(1)NoThe destination stage for the constraint.
DESCRIPTIONNoVARCHAR(50)YesA description of the constraint.
SHORTDESCNoVARCHAR(5)YesA short code (5 characters max) for the constraint.
TRACKEVENTNoCHAR(1)NoIf this field contains 'Y', when a job is changed from the FROM_STATUS to the TO_STATUS, the stage change is recorded in the Event Log.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SHORTDESC)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (DESCRIPTION)
DF__JOB_STATU__ISACT__5DC1991ADefaultColumn ConstraintISACTIVE DEFAULT N
PK__JOB_STATUS_CONST__5CCD74E1Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_TIMESHEETS
CommentThis table records the timesheet lines entered in the EXO Job Costing Timesheets add-on.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the timesheet line.
STAFFNONoINTEGERNoThe ID number of the staff member on the timesheet line.
JOBNONoINTEGERNoThe ID number of the job that the line relates to.
TITLENoVARCHAR(60)NoThe title of the job that the line relates to.
STOCKCODENoVARCHAR(23)YesThe stockcode of the labour pay item for this line.
DESCRIPTIONNoVARCHAR(60)NoThe description of the labour pay item for this line.
UNITPRICENoFLOAT(53)No
WEEK_START_DATENoDATETIMENoThe start date of the week that times are being entered for.
DAY1NoFLOAT(53)NoThe number of hours entered for day 1.
DAY1_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY1_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
DAY2NoFLOAT(53)NoThe number of hours entered for day 2.
DAY2_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY2_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
DAY3NoFLOAT(53)NoThe number of hours entered for day 3.
DAY3_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY3_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
DAY4NoFLOAT(53)NoThe number of hours entered for day 4.
DAY4_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY4_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
DAY5NoFLOAT(53)NoThe number of hours entered for day 5.
DAY5_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY5_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
DAY6NoFLOAT(53)NoThe number of hours entered for day 6.
DAY6_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY6_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
DAY7NoFLOAT(53)NoThe number of hours entered for day 7.
DAY7_POSTEDNoCHAR(1)NoThis field contain 'Y' day's times have been approved.
DAY7_NARRATIVENoINTEGERNoIf a narrative has been entered for the day, its ID number is recorded here.
IS_OVERTIMENoCHAR(1)NoThis field contains 'Y' if the line is a Special Hours rate.
LINE_IDNoINTEGERNo
RATE_SEQNONoINTEGERNoThe ID number of the Timesheet Rate in the line.
RATE_FACTORNoFLOAT(53)No
COST_GROUPNoINTEGERNo
COST_TYPENoINTEGERNo
LABOUR_ALLOWANCENoFLOAT(53)No
HAS_ALLOWANCENoCHAR(1)NoThis field contains 'Y' if allowances/deductions have been added to the line.
SOURCE_REFNoVARCHAR(20)No

Relationships:
NameRelationship typeParentChildCardinality
JOBCOST_HDR_JOB_TIMESHEETSNon IdentifyingJOBCOST_HDRJOB_TIMESHEETSZero Or More
JOBCOST_HDR_JOB_TIMESHEETS_TITLENon IdentifyingJOBCOST_HDRJOB_TIMESHEETSZero Or More
JOB_TIMESHEETS_RATES_JOB_TIMESHEETSNon IdentifyingJOB_TIMESHEETS_RATESJOB_TIMESHEETSZero Or More
STAFF_JOB_TIMESHEETSNon IdentifyingSTAFFJOB_TIMESHEETSZero Or More
STOCK_ITEMS_JOB_TIMESHEETSNon IdentifyingSTOCK_ITEMSJOB_TIMESHEETSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (STOCKCODE)
Not NullColumn ConstraintNOT NULL (SEQNO)
DF__JOB_TIMES__JOBNO__1C68D709DefaultColumn ConstraintJOBNO DEFAULT 0
DF__JOB_TIMES__LINE___1D5CFB42DefaultColumn ConstraintLINE_ID DEFAULT 0
DF__JOB_TIMES__RATE___1E511F7BDefaultColumn ConstraintRATE_SEQNO DEFAULT 0
DF__JOB_TIMES__STAFF__1B74B2D0DefaultColumn ConstraintSTAFFNO DEFAULT 0
JOBCOST_HDR_JOB_TIMESHEETSForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOBCOST_HDR_JOB_TIMESHEETS_TITLEForeign KeyTable ConstraintFOREIGN KEY (TITLE) REFERENCES JOBCOST_HDR(TITLE)
JOB_TIMESHEETS_RATES_JOB_TIMESHEETSForeign KeyTable ConstraintFOREIGN KEY (RATE_SEQNO) REFERENCES JOB_TIMESHEETS_RATES(SEQNO)
PK__JOB_TIMESHEETS__1A808E97Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_JOB_TIMESHEETSForeign KeyTable ConstraintFOREIGN KEY (STAFFNO) REFERENCES STAFF(STAFFNO)
STOCK_ITEMS_JOB_TIMESHEETSForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)



Entity: JOB_TIMESHEETS_RATES
CommentThis table records all Timesheet Rates used by the EXO Job Costing Timesheets add-on.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Timesheet Rate.
SHORTCODENoVARCHAR(5)NoA short ID code for the rate.
RATENAMENoVARCHAR(30)NoThe rate's name.
COSTRATENoFLOAT(53)NoThe factor by which the cost of transactions entered with this rate type will be multiplied when posting to a job.
SELLRATENoFLOAT(53)NoThe factor by which the charge-out rate of transactions entered with this rate type will be multiplied when posting to a job.
PAYROLLRATENoFLOAT(53)NoThe factor by which the pay rate of transactions exported via a timecard data file to your payroll base rate may be multiplied, e.g. where an employee is to be paid time-and-a-half or double time.
RATECOLORNoINTEGERNoA colour code that determines how timesheet lines of this rate should appear on the EXO Job Costing Timesheets window.
PAYROLL_ALLOWANCE_IDNoVARCHAR(5)NoAn ID number for mapping Allowances and Deductions with those defined in your payroll via your timecard data file.

Relationships:
NameRelationship typeParentChildCardinality
JOB_TIMESHEETS_RATES_JOB_TIMESHEETSNon IdentifyingJOB_TIMESHEETS_RATESJOB_TIMESHEETSZero Or More
JOB_TIMESHEETS_RATES_JOB_TRANSACTIONSNon IdentifyingJOB_TIMESHEETS_RATESJOB_TRANSACTIONSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__JOB_TIMESHEETS_R__203967EDPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_TIMESHEET_ALLOWANCE
CommentThis table contains details of all allowances added to timesheet lines.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the line.
STAFFNONoINTEGERNoThe ID number of the staff member that the line relates to.
WEEK_START_DATENoDATETIMENoThe start date of the week that the line belongs to.
ALLOWANCE_IDNoVARCHAR(5)NoThe short ID code of the allowance type on this line.
DESCRIPTIONNoVARCHAR(50)NoThe description of the allowance type on this line.
UNITNoFLOAT(53)NoThe unit of the allowance (unit type, e.g. hours, KM, is determined by the allowance type).

Relationships:
NameRelationship typeParentChildCardinality
JOB_TIMESHEET_ALLOWANCE_TYPES_JOB_TIMESHEET_ALLOWANCENon IdentifyingJOB_TIMESHEET_ALLOWANCE_TYPESJOB_TIMESHEET_ALLOWANCEZero Or More
JOB_TIMESHEET_ALLOWANCE_TYPES_JOB_TIMESHEET_ALLOWANCE_DESCNon IdentifyingJOB_TIMESHEET_ALLOWANCE_TYPESJOB_TIMESHEET_ALLOWANCEZero Or More
STAFF_JOB_TIMESHEET_ALLOWANCENon IdentifyingSTAFFJOB_TIMESHEET_ALLOWANCEZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
JOB_TIMESHEET_ALLOWANCE_TYPES_JOB_TIMESHEET_ALLOWANCEForeign KeyTable ConstraintFOREIGN KEY (ALLOWANCE_ID) REFERENCES JOB_TIMESHEET_ALLOWANCE_TYPES(ALLOWANCE_ID)
JOB_TIMESHEET_ALLOWANCE_TYPES_JOB_TIMESHEET_ALLOWANCE_DESCForeign KeyTable ConstraintFOREIGN KEY (DESCRIPTION) REFERENCES JOB_TIMESHEET_ALLOWANCE_TYPES(DESCRIPTION)
PK__JOB_TIMESHEET_AL__2221B05FPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_JOB_TIMESHEET_ALLOWANCEForeign KeyTable ConstraintFOREIGN KEY (STAFFNO) REFERENCES STAFF(STAFFNO)



Entity: JOB_TIMESHEET_ALLOWANCE_TYPES
CommentThis table records all Allowance Types used by the EXO Job Costing Timesheets add-on.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Allowance Type.
ALLOWANCE_IDNoVARCHAR(5)NoA short ID code for the type.
ALLOWANCE_FACTORNoINTEGERNo
DESCRIPTIONNoVARCHAR(50)NoDescriptive text for the Allowance Type.
UNIT_OF_MEASURENoVARCHAR(50)NoThe unit of measure that the type uses. Will be HOURS, KILOMETERS or CURRENCY.
PAYROLL_ALLOWANCE_IDNoVARCHAR(5)NoAn ID number for mapping Allowances and Deductions with those defined in your payroll via your timecard data file.

Relationships:
NameRelationship typeParentChildCardinality
JOB_TIMESHEET_ALLOWANCE_TYPES_JOB_TIMESHEET_ALLOWANCENon IdentifyingJOB_TIMESHEET_ALLOWANCE_TYPESJOB_TIMESHEET_ALLOWANCEZero Or More
JOB_TIMESHEET_ALLOWANCE_TYPES_JOB_TIMESHEET_ALLOWANCE_DESCNon IdentifyingJOB_TIMESHEET_ALLOWANCE_TYPESJOB_TIMESHEET_ALLOWANCEZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__JOB_TIMESHEET_AL__2409F8D1Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: JOB_TRANSACTIONS
CommentThis table contains line-level information on job transactions.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the line.
EXCHRATENoFLOAT(53)NoThe exchange rate applicable to the line.
DISCOUNTNoFLOAT(53)NoThe percentage discount on the line.
UNITPRICE_INCTAXNoFLOAT(53)NoThe unit price inclusive of tax.
FX_PRICENoFLOAT(53)No
RETENTION_RATENoFLOAT(53)NoThe retention rate on the line, if applicable.
RETENTION_AMOUNTNoFLOAT(53)NoThe retention amount on the line, if applicable.
OVERHEADNoFLOAT(53)NoThe overhead amount on the line, if applicable.
QUANTITYNoFLOAT(53)NoThe quantity on the line.
UNITPRICENoFLOAT(53)NoThe unit price of the item on the line.
UNITCOSTNoFLOAT(53)NoThe unit cost of the item on the line.
ENDDATENoDATETIMENoThe end date on the line (applies to timesheets).
TRANSDATENoDATETIMENoFor timesheets, this field identifies the start date; otherwise it contains the transaction date on the line.
SOURCE_SEQNONoINTEGERYesIf the line originated from a job quote, this field contains the ID of the original quote line (from JOBCOST_LINES).
JOBNONoINTEGERNoThe ID number of the job that this line is on.
MASTER_JOBNONoINTEGERNoIf the line belongs to a sub-job, this field contains the ID of the master job.
TRANSTYPENoVARCHAR(1)NoThe transaction type. Will be one of:
T = Time
C = Cost
LINE_STATUSNoVARCHAR(30)NoThe line's status. Will be one of:
R = Ready to invoice
W = Writeoff
I = Invoiced
X = Cancelled
A = Asset
C = Committed Stock
STOCKCODENoVARCHAR(23)NoThe stockcode of the stock item on this line.
DESCRIPTIONNoVARCHAR(60)NoThe description of the stock item on this line.
COST_TYPENoINTEGERNoThe ID number of the Cost Type on the line (from JOB_COSTTYPES).
COST_GROUPNoINTEGERNoThe ID number of the Cost Group on the line (from JOB_COSTGROUPS).
LINE_SOURCENoVARCHAR(10)NoWhere the line was sourced from. Will be one of:
P = Purchase
Q = Quote
SOURCE_IDNoINTEGERNoIf the line originated from a job quote, this field contains the ID of the original quote line (from JOBCOST_LINES).
NARRATIVENoVARCHAR(1)No
STAFFNONoINTEGERNoID number of the staff member on the line.
STARTTIMENoVARCHAR(15)NoStart time (only applies to timesheets).
ENDTIMENoVARCHAR(15)NoEnd Time (only applies to timesheets).
FROMLOCNoINTEGERNoThe location origin for stock movements.
LOCATIONNoINTEGERNoThe location that the item moves to.
GLCODENoINTEGERNoThe GL account code of the P&L revenue account.
BRANCHNONoINTEGERNoThe ID number of the branch that the line belongs to (from BRANCHES).
SUBCODENoINTEGERNoThe subcode of the P&L revenue account.
LINESORTNoINTEGERNo
TAXNONoINTEGERNoThe ID number of the tax rate on the line (from TAX_RATES).
ANALYSISNoINTEGERNo
CURRENCYNONoINTEGERNoThe ID number of the currency on the line (from CURRENCIES).
BILLING_IDNoINTEGERNoThe Billing ID, if one exists.
BILLING_REFNoVARCHAR(20)NoThe Billing Reference, if one exists.
INVOICEDNoFLOAT(53)YesThe amount invoiced.
INVOICEDQTYNoFLOAT(53)YesThe quantity invoiced.
ALINENONoINTEGERYesA rank ID that determines the order in which lines are displayed.
INVOICEDATENoDATETIMENoThe invoice date
NARRATIVE_SEQNONoINTEGERNoThe ID number of the narrative on the line, if there is one (from NARRATIVES).
DIM_LENGTHNoFLOAT(53)YesDimension length
DIM_WIDTHNoFLOAT(53)YesDimension width
DIM_DEPTHNoFLOAT(53)YesDimension depth
TOTAL_QUANTITYNoASNoThe total quantity after considering the dimensions (if applicable).
PRICE_OVERRIDDENNoCHAR(1)YesThis field contains 'Y' if the unit price or discount has been overridden.
NUNITPRNoASNoThe unit price after discount.
LINETYPENoINTEGERYesThe type of line. Will be one of:
0 = Normal
1 = BOM header
2 = Component
4 = Comment line
KITSEQNONoINTEGERYesThe ID number of the Bill of Materials, if the stock line belongs to a one.
KITCODENoVARCHAR(23)NoThe ID code of the Bill of Materials, if the stock line belongs to a one (from BILLOMAT_HDR).
LINKED_STOCKCODENoVARCHAR(23)NoCode of the linked stock item
LINKED_QTYNoFLOAT(53)NoQuantity (if the item is a linked stock item).
JOBLINEIDNoINTEGERYesID of the job transaction line
BOMTYPENoCHAR(1)NoWill be one of:
N = Normal stock item
B = Build
K = Kit
L = Lookup item
BOMPRICINGNoCHAR(1)NoWill be one of:
N = normal
C = pricing by component (BOMs)
T= pricing by total (BOMs)
SHOWLINENoCHAR(1)NoFlag to indicate if the BOM item line should be printed on Clarity reports or not.
LINKEDSTATUSNoCHAR(1)NoS= Stocked, L= Lookup, N= Not Applicable
LISTPRICENoFLOAT(53)NoThe original sell price of the item.
HIDDEN_COSTNoFLOAT(53)YesThis field applies to Bills of Materials. For kits that use pricing by components, this field stores header-level cost prices. For builds that use individual stock lines, this field stores the real cost.
HIDDEN_SELLNoFLOAT(53)YesThis field applies to Bills of Materials. For kits that use pricing by components, this field stores header-level sell prices. For builds that use individual stock lines, this field stores the sell price.
LINECOSTNoASNoCalculated field giving the cost of the transactions line.
LINECHARGENoASNoCalculated field giving the total price of the transaction line (excluding discount).
LINETOTALNoASNoTotal price of the transaction line including discount.
SOURCE_REFNoVARCHAR(20)NoSource reference.
BATCHCODENoVARCHAR(20)NoBatch code.
SPREADVALUENoCHAR(1)YesIf this field contains 'Y', the line will be taken into account when using the spread function to alter the total.
TAXRATENoFLOAT(53)YesThe tax rate percentage on the line.
LINETOTAL_TAXNoFLOAT(53)YesThe total tax value for line
LINE_TAXNoFLOAT(53)YesThe tax value on the line.
HIDDEN_LINETOTALNoFLOAT(53)YesFor Kit type BOMs, this field stores the line total against the header line.
PO_LINESEQNONoINTEGERYesThe related Purchase Order line ID, if applicable (from PURCHORD_LINES).
INVSEQNONoINTEGERYesThe related Debtor Invoice ID, if applicable (from DR_TRANS).
INVLINE_SEQNONoINTEGERYesThe related Debtor Invoice line ID, if applicable (from DR_INVLINES).
SCHEDULE_SEQNONoINTEGERYesThe related Billing Schedule ID, if the line is allocated to a Billing Schedule (from JOB_CONTRACT_BILLINGS).
WIP_OUT_DATENoDATETIMENoThe date and time when the stock moved out of WIP.
ALLOWANCENoFLOAT(53)YesUnit labour allowance associated with the stock item.
PROGRESSINVOICENoCHAR(1)YesThis field contains 'Y' if the line is allocated to a Billing Schedule.
RATE_SEQNONoINTEGERYesTimesheet Rate ID from JOB_TIMESHEETS_RATES)
LINETOTAL_INCTAXNoASNoLine total inclusive of discount and tax(Calculated field)
PAYROLL_STATUSNoCHAR(1)YesOnly applicable when timesheets are integrated with MYOB EXO Payroll. Will be one of:
Y = the line is ready to invoice
N = the line is not ready to post
P = the line has been invoiced
PAYROLL_HOURSNoFLOAT(53)YesPayroll hours (only applicable when timesheets are integrated with MYOB EXO Payroll).
PAYRATE_NONoINTEGERYesPay Rate ID (only applicable when timesheets are integrated with MYOB EXO Payroll).
PAYRATENoFLOAT(53)YesPay Rate percentage (only applicable when timesheets are integrated with MYOB EXO Payroll).
PAYRATE_OVERRIDENNoFLOAT(53)YesThis field contains 'Y' if the payrate has been modified; otherwise 'N' (only applicable when timesheets are integrated with MYOB EXO Payroll).
WAGE_CODENoINTEGERYesWage code (only applicable when timesheets are integrated with MYOB EXO Payroll).
COST_CENTRENoBIGINTYesCost Centre ID (only applicable when timesheets are integrated with MYOB EXO Payroll).
ISSUPPLIEDNoCHAR(1)YesThis field contains 'Y' if the line is supplied; otherwise 'N'.
SNTYPENoINTEGERNoSerial number type.
SNEXPDAYSNoINTEGERNoSerial Number expiry days.
SU_SEQNONoINTEGERYesThe ID number of the Serviceable Unit that the line is associated with, if applicable.
STDCOST_INNoFLOAT(53)NoThe Standard cost of the item coming into the WIP location.
STDCOST_OUTNoFLOAT(53)NoThe Standard cost of the item going out of the WIP location.
AVECOST_INNoFLOAT(53)NoThe Average cost of the item coming into the WIP location.
AVECOST_OUTNoFLOAT(53)NoThe Average cost of the item going out of the WIP location
LATESTCOST_INNoFLOAT(53)NoThe Latest cost of the item coming into the WIP location.
LATESTCOST_OUTNoFLOAT(53)NoThe Latest cost of the item going out of the WIP location.
LOOKUP_RECOVERABLENoCHAR(1)NoThis field contains 'Y' if lookups are recoverable against expenses in Job Costing.
COST_LINENONoINTEGERYesThis field stores the COST_LINENO from DR_INVLINES.
LINECHARGE_WRITEOFFNoFLOAT(53)NoThis field stores the value of LINECHARGE before the line was written off.
CREDIT_SCHEDULE_SEQNONoINTEGERYesThis field stores the ID number of the Billing Schedule record that the current record was credited in.
WIP_IN_PERIOD_SEQNONoINTEGERYesPERIOD_SEQNO for WIP_IN_DATE
WIP_OUT_PERIOD_SEQNONoINTEGERYesPERIOD_SEQNO for WIP_OUT_DATE
STOCK_TRANS_SEQ_INNoINTEGERYesThis field stores the STOCK_TRANS.SEQNO from the Purchase Order line that inserted the job transaction.

Relationships:
NameRelationship typeParentChildCardinality
BILLOMAT_HDR_JOB_TRANSACTIONSNon IdentifyingBILLOMAT_HDRJOB_TRANSACTIONSZero Or More
BRANCHES_JOB_TRANSACTIONSNon IdentifyingBRANCHESJOB_TRANSACTIONSZero Or More
CURRENCIES_JOB_TRANSACTIONSNon IdentifyingCURRENCIESJOB_TRANSACTIONSZero Or More
DR_INVLINES_JOB_TRANSACTIONSNon IdentifyingDR_INVLINESJOB_TRANSACTIONSZero Or More
DR_TRANS_JOB_TRANSACTIONSNon IdentifyingDR_TRANSJOB_TRANSACTIONSZero Or More
GLACCS_JOB_TRANSACTIONSNon IdentifyingGLACCSJOB_TRANSACTIONSZero Or More
JOBCOST_HDR_JOB_TRANSACTIONSNon IdentifyingJOBCOST_HDRJOB_TRANSACTIONSZero Or More
JOBCOST_HDR_JOB_TRANSACTIONS_MASTERNon IdentifyingJOBCOST_HDRJOB_TRANSACTIONSZero Or More
JOBCOST_LINES_JOB_TRANSACTIONSNon IdentifyingJOBCOST_LINESJOB_TRANSACTIONSZero Or More
JOB_CONTRACT_BILLINGS_JOB_TRANSACTIONSNon IdentifyingJOB_CONTRACT_BILLINGSJOB_TRANSACTIONSZero Or More
JOB_COSTGROUPS_JOB_TRANSACTIONSNon IdentifyingJOB_COSTGROUPSJOB_TRANSACTIONSZero Or More
JOB_COSTTYPES_JOB_TRANSACTIONSNon IdentifyingJOB_COSTTYPESJOB_TRANSACTIONSZero Or More
JOB_TIMESHEETS_RATES_JOB_TRANSACTIONSNon IdentifyingJOB_TIMESHEETS_RATESJOB_TRANSACTIONSZero Or More
NARRATIVES_JOB_TRANSACTIONSNon IdentifyingNARRATIVESJOB_TRANSACTIONSZero Or More
PURCHORD_LINES_JOB_TRANSACTIONSNon IdentifyingPURCHORD_LINESJOB_TRANSACTIONSZero Or More
STAFF_JOB_TRANSACTIONSNon IdentifyingSTAFFJOB_TRANSACTIONSZero Or More
STOCK_ITEMS_JOB_TRANSACTIONSNon IdentifyingSTOCK_ITEMSJOB_TRANSACTIONSZero Or More
STOCK_ITEMS_JOB_TRANSACTIONS_DESCNon IdentifyingSTOCK_ITEMSJOB_TRANSACTIONSZero Or More
TAX_RATES_JOB_TRANSACTIONSNon IdentifyingTAX_RATESJOB_TRANSACTIONSZero Or More

Indexes:
NameIndex columnsIndex type
SK_JC4JOBNO ASC
SK_JC5LINE_STATUS ASC
WIP_IN_PERIOD_SEQNO_INDEXWIP_IN_PERIOD_SEQNO ASC
WIP_OUT_PERIOD_SEQNO_INDEXWIP_OUT_PERIOD_SEQNO ASC

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (STOCK_TRANS_SEQ_IN)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (WIP_OUT_PERIOD_SEQNO)
Not NullColumn ConstraintNOT NULL (WIP_IN_PERIOD_SEQNO)
Not NullColumn ConstraintNOT NULL (CREDIT_SCHEDULE_SEQNO)
Not NullColumn ConstraintNOT NULL (COST_LINENO)
Not NullColumn ConstraintNOT NULL (SU_SEQNO)
Not NullColumn ConstraintNOT NULL (ISSUPPLIED)
Not NullColumn ConstraintNOT NULL (COST_CENTRE)
Not NullColumn ConstraintNOT NULL (WAGE_CODE)
Not NullColumn ConstraintNOT NULL (SOURCE_SEQNO)
Not NullColumn ConstraintNOT NULL (PAYRATE_OVERRIDEN)
Not NullColumn ConstraintNOT NULL (PAYRATE)
Not NullColumn ConstraintNOT NULL (PAYRATE_NO)
Not NullColumn ConstraintNOT NULL (PAYROLL_HOURS)
Not NullColumn ConstraintNOT NULL (PAYROLL_STATUS)
Not NullColumn ConstraintNOT NULL (RATE_SEQNO)
Not NullColumn ConstraintNOT NULL (PROGRESSINVOICE)
Not NullColumn ConstraintNOT NULL (ALLOWANCE)
Not NullColumn ConstraintNOT NULL (SCHEDULE_SEQNO)
Not NullColumn ConstraintNOT NULL (INVOICED)
Not NullColumn ConstraintNOT NULL (INVLINE_SEQNO)
Not NullColumn ConstraintNOT NULL (INVOICEDQTY)
Not NullColumn ConstraintNOT NULL (INVSEQNO)
Not NullColumn ConstraintNOT NULL (ALINENO)
Not NullColumn ConstraintNOT NULL (PO_LINESEQNO)
Not NullColumn ConstraintNOT NULL (DIM_LENGTH)
Not NullColumn ConstraintNOT NULL (HIDDEN_LINETOTAL)
Not NullColumn ConstraintNOT NULL (DIM_WIDTH)
Not NullColumn ConstraintNOT NULL (LINE_TAX)
Not NullColumn ConstraintNOT NULL (DIM_DEPTH)
Not NullColumn ConstraintNOT NULL (LINETOTAL_TAX)
Not NullColumn ConstraintNOT NULL (PRICE_OVERRIDDEN)
Not NullColumn ConstraintNOT NULL (TAXRATE)
Not NullColumn ConstraintNOT NULL (LINETYPE)
Not NullColumn ConstraintNOT NULL (SPREADVALUE)
Not NullColumn ConstraintNOT NULL (KITSEQNO)
Not NullColumn ConstraintNOT NULL (HIDDEN_SELL)
Not NullColumn ConstraintNOT NULL (HIDDEN_COST)
Not NullColumn ConstraintNOT NULL (JOBLINEID)
BILLOMAT_HDR_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (KITCODE) REFERENCES BILLOMAT_HDR(BILLCODE)
BRANCHES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (BRANCHNO) REFERENCES BRANCHES(BRANCHNO)
CURRENCIES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (CURRENCYNO) REFERENCES CURRENCIES(CURRENCYNO)
DF__JOB_TRANS__ALINE__32F66B4FDefaultColumn ConstraintALINENO DEFAULT 0
DF__JOB_TRANS__ALLOW__4CEC12D3DefaultColumn ConstraintALLOWANCE DEFAULT 0
DF__JOB_TRANS__ANALY__015F0FBBDefaultColumn ConstraintANALYSIS DEFAULT 0
DF__JOB_TRANS__BOMPR__6498B3DBDefaultColumn ConstraintBOMPRICING DEFAULT N
DF__JOB_TRANS__BOMTY__63A48FA2DefaultColumn ConstraintBOMTYPE DEFAULT N
DF__JOB_TRANS__BRANC__7D8E7ED7DefaultColumn ConstraintBRANCHNO DEFAULT 0
DF__JOB_TRANS__COST___0882A544DefaultColumn ConstraintCOST_LINENO DEFAULT -1
DF__JOB_TRANS__COST___342B5201DefaultColumn ConstraintCOST_CENTRE DEFAULT -1
DF__JOB_TRANS__CREDI__01A09D8BDefaultColumn ConstraintCREDIT_SCHEDULE_SEQNO DEFAULT -1
DF__JOB_TRANS__CURRE__025333F4DefaultColumn ConstraintCURRENCYNO DEFAULT 0
DF__JOB_TRANS__DIM_D__3A6282EDDefaultColumn ConstraintDIM_DEPTH DEFAULT 1
DF__JOB_TRANS__DIM_L__387A3A7BDefaultColumn ConstraintDIM_LENGTH DEFAULT 1
DF__JOB_TRANS__DIM_W__396E5EB4DefaultColumn ConstraintDIM_WIDTH DEFAULT 1
DF__JOB_TRANS__DISCO__7405149DDefaultColumn ConstraintDISCOUNT DEFAULT 0
DF__JOB_TRANS__ENDDA__78C9C9BADefaultColumn ConstraintENDDATE DEFAULT getdate()
DF__JOB_TRANS__EXCHR__7310F064DefaultColumn ConstraintEXCHRATE DEFAULT 1
DF__JOB_TRANS__FROML__7AB2122CDefaultColumn ConstraintFROMLOC DEFAULT 0
DF__JOB_TRANS__FX_PR__75ED5D0FDefaultColumn ConstraintFX_PRICE DEFAULT 0
DF__JOB_TRANS__GLCOD__7C9A5A9EDefaultColumn ConstraintGLCODE DEFAULT 0
DF__JOB_TRANS__HIDDE__626652A6DefaultColumn ConstraintHIDDEN_LINETOTAL DEFAULT 0
DF__JOB_TRANS__HIDDE__768259ECDefaultColumn ConstraintHIDDEN_COST DEFAULT 0
DF__JOB_TRANS__HIDDE__77767E25DefaultColumn ConstraintHIDDEN_SELL DEFAULT 0
DF__JOB_TRANS__INVLI__6A07746EDefaultColumn ConstraintINVLINE_SEQNO DEFAULT -1
DF__JOB_TRANS__INVOI__310E22DDDefaultColumn ConstraintINVOICED DEFAULT 0
DF__JOB_TRANS__INVOI__32024716DefaultColumn ConstraintINVOICEDQTY DEFAULT 0
DF__JOB_TRANS__INVSE__69135035DefaultColumn ConstraintINVSEQNO DEFAULT -1
DF__JOB_TRANS__ISSUP__3707BEACDefaultColumn ConstraintISSUPPLIED DEFAULT N
DF__JOB_TRANS__JOBLI__34E9A0B9DefaultColumn ConstraintJOBLINEID DEFAULT -1
DF__JOB_TRANS__KITSE__090B1E7BDefaultColumn ConstraintKITSEQNO DEFAULT -1
DF__JOB_TRANS__LINEC__0B5F11EFDefaultColumn ConstraintLINECHARGE_WRITEOFF DEFAULT 0
DF__JOB_TRANS__LINES__7F76C749DefaultColumn ConstraintLINESORT DEFAULT 0
DF__JOB_TRANS__LINET__0816FA42DefaultColumn ConstraintLINETYPE DEFAULT -1
DF__JOB_TRANS__LINET__5E95C1C2DefaultColumn ConstraintLINETOTAL_TAX DEFAULT 0
DF__JOB_TRANS__LINE___607E0A34DefaultColumn ConstraintLINE_TAX DEFAULT 0
DF__JOB_TRANS__LINKE__09FF42B4DefaultColumn ConstraintLINKED_QTY DEFAULT 0
DF__JOB_TRANS__LINKE__6680FC4DDefaultColumn ConstraintLINKEDSTATUS DEFAULT N
DF__JOB_TRANS__LOCAT__7BA63665DefaultColumn ConstraintLOCATION DEFAULT 0
DF__JOB_TRANS__LOOKU__078E810BDefaultColumn ConstraintLOOKUP_RECOVERABLE DEFAULT Y
DF__JOB_TRANS__PAYRA__305AC11DDefaultColumn ConstraintPAYRATE_NO DEFAULT -1
DF__JOB_TRANS__PAYRA__314EE556DefaultColumn ConstraintPAYRATE DEFAULT -1
DF__JOB_TRANS__PAYRA__3243098FDefaultColumn ConstraintPAYRATE_OVERRIDEN DEFAULT -1
DF__JOB_TRANS__PAYRO__2E7278ABDefaultColumn ConstraintPAYROLL_STATUS DEFAULT N
DF__JOB_TRANS__PAYRO__2F669CE4DefaultColumn ConstraintPAYROLL_HOURS DEFAULT 0
DF__JOB_TRANS__PO_LI__644E9B18DefaultColumn ConstraintPO_LINESEQNO DEFAULT -1
DF__JOB_TRANS__PRICE__206DA6C0DefaultColumn ConstraintPRICE_OVERRIDDEN DEFAULT N
DF__JOB_TRANS__PROGR__4B8DDA46DefaultColumn ConstraintPROGRESSINVOICE DEFAULT N
DF__JOB_TRANS__RATE___24FE1D0ADefaultColumn ConstraintRATE_SEQNO DEFAULT 0
DF__JOB_TRANS__RETEN__76E18148DefaultColumn ConstraintRETENTION_RATE DEFAULT 0
DF__JOB_TRANS__RETEN__77D5A581DefaultColumn ConstraintRETENTION_AMOUNT DEFAULT 0
DF__JOB_TRANS__SCHED__41255A6CDefaultColumn ConstraintSCHEDULE_SEQNO DEFAULT 0
DF__JOB_TRANS__SHOWL__658CD814DefaultColumn ConstraintSHOWLINE DEFAULT Y
DF__JOB_TRANS__SNEXP__025EEC43DefaultColumn ConstraintSNEXPDAYS DEFAULT -1
DF__JOB_TRANS__SNTYP__0076A3D1DefaultColumn ConstraintSNTYPE DEFAULT -1
DF__JOB_TRANS__SPREA__5AC530DEDefaultColumn ConstraintSPREADVALUE DEFAULT Y
DF__JOB_TRANS__STOCK__12B61AF4DefaultColumn ConstraintSTOCK_TRANS_SEQ_IN DEFAULT -1
DF__JOB_TRANS__SUBCO__7E82A310DefaultColumn ConstraintSUBCODE DEFAULT 0
DF__JOB_TRANS__SU_SE__3025B6F3DefaultColumn ConstraintSU_SEQNO DEFAULT -1
DF__JOB_TRANS__TAXNO__006AEB82DefaultColumn ConstraintTAXNO DEFAULT 0
DF__JOB_TRANS__TAXRA__5CAD7950DefaultColumn ConstraintTAXRATE DEFAULT 0
DF__JOB_TRANS__TRANS__79BDEDF3DefaultColumn ConstraintTRANSDATE DEFAULT getdate()
DF__JOB_TRANS__UNITP__74F938D6DefaultColumn ConstraintUNITPRICE_INCTAX DEFAULT 0
DF__JOB_TRANS__WAGE___33372DC8DefaultColumn ConstraintWAGE_CODE DEFAULT -1
DF__JOB_TRANS__WIP_I__066552A8DefaultColumn ConstraintWIP_IN_PERIOD_SEQNO DEFAULT -1
DF__JOB_TRANS__WIP_O__075976E1DefaultColumn ConstraintWIP_OUT_PERIOD_SEQNO DEFAULT -1
DR_INVLINES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (INVLINE_SEQNO) REFERENCES DR_INVLINES(SEQNO)
DR_TRANS_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (INVSEQNO) REFERENCES DR_TRANS(SEQNO)
GLACCS_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (GLCODE) REFERENCES GLACCS(ACCNO)
JOBCOST_HDR_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOBCOST_HDR_JOB_TRANSACTIONS_MASTERForeign KeyTable ConstraintFOREIGN KEY (MASTER_JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOBCOST_LINES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (SOURCE_SEQNO) REFERENCES JOBCOST_LINES(SEQNO)
JOB_CONTRACT_BILLINGS_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (SCHEDULE_SEQNO) REFERENCES JOB_CONTRACT_BILLINGS(SEQNO)
JOB_COSTGROUPS_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (COST_GROUP) REFERENCES JOB_COSTGROUPS(SEQNO)
JOB_COSTTYPES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (COST_TYPE) REFERENCES JOB_COSTTYPES(SEQNO)
JOB_TIMESHEETS_RATES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (RATE_SEQNO) REFERENCES JOB_TIMESHEETS_RATES(SEQNO)
NARRATIVES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (NARRATIVE_SEQNO) REFERENCES NARRATIVES(SEQNO)
PK__JOB_TRANSACTIONS__721CCC2BPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
PURCHORD_LINES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (PO_LINESEQNO) REFERENCES PURCHORD_LINES(SEQNO)
STAFF_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (STAFFNO) REFERENCES STAFF(STAFFNO)
STOCK_ITEMS_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)
STOCK_ITEMS_JOB_TRANSACTIONS_DESCForeign KeyTable ConstraintFOREIGN KEY (DESCRIPTION) REFERENCES STOCK_ITEMS(DESCRIPTION)
TAX_RATES_JOB_TRANSACTIONSForeign KeyTable ConstraintFOREIGN KEY (TAXNO) REFERENCES TAX_RATES(SEQNO)

Triggers:
Trigger nameCode
JOB_STOCK_OUT_TO_WIPCREATE TRIGGER [dbo].[JOB_STOCK_OUT_TO_WIP] ON [dbo].[JOB_TRANSACTIONS]
FOR INSERT
AS
BEGIN
 SET NOCOUNT ON
 DECLARE @WIPLOC INT, @DEFLOC INT, @STOCKCODE VARCHAR(23), @TOTAL_QUANTITY FLOAT, @NUNITPR FLOAT,
 @LOCATION INT, @JOBNO INT, @SEQNO INT, @TRANSDATE DATETIME
 EXECUTE GET_PROFILE_VALUE_INT 'JOBDEFWIPLOC', @WIPLOC OUTPUT
 SELECT @STOCKCODE=STOCKCODE, @TOTAL_QUANTITY=TOTAL_QUANTITY, @NUNITPR=NUNITPR, @LOCATION=LOCATION,
 @JOBNO=JOBNO, @SEQNO=SEQNO, @TRANSDATE=TRANSDATE FROM INSERTED
 IF (@STOCKCODE IS NOT NULL) AND (@STOCKCODE <> '') AND (@WIPLOC=0) AND (@LOCATION<>@WIPLOC)
 BEGIN
   INSERT INTO STOCK_TRANS (STOCKCODE, QUANTITY, REF1, REF2, UNITPRICE, LOCATION, TOLOCATION, FROM_LEDGER,
   JOBNO, LINE_SEQNO, TRANSDATE, TRANSTYPE)
   VALUES (@STOCKCODE, -@TOTAL_QUANTITY, 'JOBCOST', 'T/FER OUT TO WIP', @NUNITPR, @LOCATION, @WIPLOC, 'j',
   @JOBNO, @SEQNO, @TRANSDATE, 2)
 END
 SET NOCOUNT OFF
END
JOB_TRANSACTIONS_INSERT-- =============================================
-- Description: This is a Insert trigger for [dbo].[JOB_TRANSACTIONS]. It intercepts the inserts to
-- [dbo].[JOB_TRANSACTIONS] to set the AVECOST, STDCOST and LATESTCOST at the time of inserting
-- =============================================
CREATE TRIGGER [dbo].[JOB_TRANSACTIONS_INSERT]
   ON [dbo].[JOB_TRANSACTIONS]
   FOR INSERT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

DECLARE @JT_SEQNO INT

    SELECT @JT_SEQNO = SEQNO
    FROM INSERTED

    UPDATE J
    SET J.AVECOST_IN = S.AVECOST,
J.STDCOST_IN = S.STDCOST,
J.LATESTCOST_IN = S.LATESTCOST,
J.LOOKUP_RECOVERABLE = CASE
WHEN S.[STATUS] = 'S' THEN 'Y'
WHEN (S.[STATUS] = 'L' AND (ISNULL(LTRIM(S.UPDATEITEM_CODE), '') <> '')) OR (S.STOCKCODE = '@') THEN 'N'
ELSE S.LOOKUP_RECOVERABLE
END
    FROM [dbo].[JOB_TRANSACTIONS] J
    JOIN STOCK_ITEMS S ON S.STOCKCODE=J.STOCKCODE
    WHERE J.SEQNO = @JT_SEQNO
END


Entity: JOB_TYPES
CommentThis table contains details of the available Job Types.
Primary key columnsTYPENO

Attributes:
Column namePrimary keyData typeNot NULLComment
TYPENOYesINTEGERYesA unique ID number for the Job Type.
TYPEDESCNoVARCHAR(40)NoDescriptive text for the type.
SHORTCODENoVARCHAR(3)NoA short (max. three characters) ID code for the type.
GANTTBAR_COLOURNoINTEGERNoA colour code that determines how jobs of this type should appear on the diagram on the Job Overview tab.

Relationships:
NameRelationship typeParentChildCardinality
JOB_TYPES_JOBCOST_HDRNon IdentifyingJOB_TYPESJOBCOST_HDRZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (TYPENO)
PK__JOB_TYPES__0717E911Primary KeyTable ConstraintPRIMARY KEY (TYPENO)



Entity: NARRATIVES
CommentThis table contains the narratives attached to transactions.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the narrative.
NARRATIVENoVARCHAR(4096)NoThe text of the narrative.

Relationships:
NameRelationship typeParentChildCardinality
NARRATIVES_CR_INVLINESNon IdentifyingNARRATIVESCR_INVLINESZero Or More
NARRATIVES_CR_TRANSNon IdentifyingNARRATIVESCR_TRANSZero Or More
NARRATIVES_DR_INVLINESNon IdentifyingNARRATIVESDR_INVLINESZero Or More
NARRATIVES_DR_TRANSNon IdentifyingNARRATIVESDR_TRANSZero Or More
NARRATIVES_JOBCOST_LINESNon IdentifyingNARRATIVESJOBCOST_LINESZero Or More
NARRATIVES_JOB_CONTRACT_BILLINGSNon IdentifyingNARRATIVESJOB_CONTRACT_BILLINGSZero Or More
NARRATIVES_JOB_TRANSACTIONSNon IdentifyingNARRATIVESJOB_TRANSACTIONSZero Or More
NARRATIVES_OPPORTUNITY_QUOTENon IdentifyingNARRATIVESOPPORTUNITY_QUOTEZero Or More
NARRATIVES_PURCHORD_HDRNon IdentifyingNARRATIVESPURCHORD_HDRZero Or More
NARRATIVES_SALESORD_HDRNon IdentifyingNARRATIVESSALESORD_HDRZero Or More
NARRATIVES_STOCK_REQUESTLINESNon IdentifyingNARRATIVESSTOCK_REQUESTLINESZero Or More
NARRATIVES_STOCK_REQUESTSNon IdentifyingNARRATIVESSTOCK_REQUESTSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__NARRATIVES__2E31B632Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: STAFF
CommentThis table stores details of all EXO Business staff members. These are the people who are authorised to log in to and use the EXO Business system.
Primary key columnsSTAFFNO

Attributes:
Column namePrimary keyData typeNot NULLComment
STAFFNOYesINTEGERYesA unique identifier for the staff record.
NAMENoVARCHAR(30)NoThe staff member's full name.
JOBTITLENoVARCHAR(30)NoThe staff member's job title.
EXTENSIONNoVARCHAR(12)NoThe staff member's telephone extension.
PHONENoVARCHAR(30)NoThe staff member's work telephone number.
HOMEPHONENoVARCHAR(30)NoThe staff member's home telephone number.
ISACTIVENoCHAR(1)NoThis field is set to 'Y' if the staff member is currently active, i.e. if their Active flag is ticked in EXO Business Configurator.
APP_PASSWORDNoVARCHAR(30)NoThe staff member's password, used when logging in to the EXO Business system. Passwords are stored in an encrypted format.
MENU_NONoINTEGERNoThe ID number of the Menu Definition specified for the staff member. Corresponds to the menu's SEQNO field in the MENU_COLLECTION table.
AUTH_AMTNoFLOAT(53)NoThe staff member's Credit Invoice Authorisation Limit.
STOCK_AUTH_AMTNoFLOAT(53)NoThe staff member's Stock Purchase Order Authorisation Limit.
NON_STOCK_AUTH_AMTNoFLOAT(53)NoThe staff member's Non-Stock Purchase Order Authorisation Limit.
SECURITYPROFILEIDNoINTEGERYesThe ID number of the staff member's Security profile. Corresponds to the profile's ID field in the PROFILE table.
USERPROFILEIDNoINTEGERYesThe ID number of the staff member's User profile. Corresponds to the profile's ID field in the PROFILE table.
LOGINIDNoVARCHAR(30)YesThe staff member's login ID. This is the ID used to log in to the EXO Business system.
PASSWORD_CHANGEDNoDATETIMEYesThe date and time when the staff member's password was last changed.
LAST_BAD_LOGINNoDATETIMENoThe date and time when the staff member last attempted to log in but failed.
BAD_LOGIN_COUNTNoINTEGERYesThe number of times the staff member has attempted to log in but failed.
LAST_LOGINNoDATETIMENoThe date and time when the staff member last successfully logged in.
ACCOUNT_STATUSNoINTEGERYesThe staff member's account status. Will be one of:
0 = Account OK
1 = Account Locked
2 = Password Expired
EMAIL_ADDRESSNoVARCHAR(50)NoThe staff member's email address.
DISCOUNTRATENoFLOAT(53)YesThe staff member's Discount Rate Limit.
PAYROLL_IDNoVARCHAR(15)NoThe staff member's Employee ID (Payroll) number. This field is used when EXO Business is integrating with an external payroll system, e.g. MYOB EXO Payroll. It must contain the employee's corresponding ID number in the payroll system.
IS_SUPERVISORNoCHAR(1)YesThis field is set to 'Y' if the staff member is designated as a supervisor, i.e. if their Has supervisory override authority flag is ticked.
NICKNAMENoVARCHAR(15)NoA short nickname for the employee.
ABSENTNoCHAR(1)YesThis field is set to 'Y' if the staff member is currently absent, i.e. if their Absent flag is ticked in EXO Business Configurator.
EMPLOYEE_CODENoINTEGERYesThis field is used by the payroll integration functionality.
SMTP_SEQNONoINTEGERNoWhere emails are sent via SMTP using the EXO Business Email Sender, this field contains the ID of the SMTP settings that apply to the staff member (SMTP_ACCOUNT.SEQNO). Set up via the SMTP Server Settings window.
HAS_BUDGETSNoCHAR(1)NoThis field is set to 'Y' if the staff member has been assigned a Sales Team Budget, i.e. if their Has Budget flag is ticked in EXO Business Configurator.
REPORTS_TO_STAFFNONoINTEGERNoThe ID number of the staff member that this staff member reports to.
FACEBOOK_ACCESS_TOKENNoVARCHAR(max)NoIf the staff member uses their own Facebook account when using the EXO Business social media functions, their encrypted access token is stored here.
LINKEDIN_TOKEN_KEYNoVARCHAR(max)NoIf the staff member uses their own LinkedIn account when using the EXO Business social media functions, their encrypted access token key is stored here.
LINKEDIN_TOKEN_SECRETNoVARCHAR(max)NoIf the staff member uses their own LinkedIn account when using the EXO Business social media functions, their encrypted access token secret is stored here.
TWITTER_TOKEN_KEYNoVARCHAR(max)NoIf the staff member uses their own Twitter account when using the EXO Business social media functions, their encrypted access token key is stored here.
TWITTER_TOKEN_SECRETNoVARCHAR(max)NoIf the staff member uses their own Twitter account when using the EXO Business social media functions, their encrypted access token secret is stored here.
API_ACCESSNoCHAR(1)NoThis field contains 'Y' if the staff member is authorised to use the EXO API.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_STAFF_STAFFNon IdentifyingSTAFFCRM_BUDGET_EXCLUDED_STAFFZero Or More
FK_CRM_BUDGET_LINE_STAFFNon IdentifyingSTAFFCRM_BUDGET_LINEZero Or More
MENU_COLLECTION_STAFFNon IdentifyingMENU_COLLECTIONSTAFFZero Or More
STAFF_BILLOMAT_TEMPNon IdentifyingSTAFFBILLOMAT_TEMPZero Or More
STAFF_CAMPAIGNNon IdentifyingSTAFFCAMPAIGNZero Or More
STAFF_CAMPAIGN_HISTNon IdentifyingSTAFFCAMPAIGN_HISTZero Or More
STAFF_CONTACTSNon IdentifyingSTAFFCONTACTSZero Or More
STAFF_CONTACT_LISTNon IdentifyingSTAFFCONTACT_LISTZero Or More
STAFF_CONTACT_LIST1Non IdentifyingSTAFFCONTACT_LISTZero Or More
STAFF_CR_ACCSNon IdentifyingSTAFFCR_ACCSZero Or More
STAFF_CR_CONT_HISTNon IdentifyingSTAFFCR_CONT_HISTZero Or More
STAFF_DASHBOARDS_STAFFNon IdentifyingSTAFFDASHBOARDS_STAFFZero Or More
STAFF_DR_ACCSNon IdentifyingSTAFFDR_ACCSOne Or More
STAFF_DR_CONT_HISTNon IdentifyingSTAFFDR_CONT_HISTOne Or More
STAFF_DR_TRANSNon IdentifyingSTAFFDR_TRANSZero Or More
STAFF_JOBCOST_HDRNon IdentifyingSTAFFJOBCOST_HDRZero Or More
STAFF_JOBCOST_HDR_MGRNon IdentifyingSTAFFJOBCOST_HDRZero Or More
STAFF_JOBCOST_RESOURCENon IdentifyingSTAFFJOBCOST_RESOURCEZero Or More
STAFF_JOB_TIMESHEETSNon IdentifyingSTAFFJOB_TIMESHEETSZero Or More
STAFF_JOB_TIMESHEET_ALLOWANCENon IdentifyingSTAFFJOB_TIMESHEET_ALLOWANCEZero Or More
STAFF_JOB_TRANSACTIONSNon IdentifyingSTAFFJOB_TRANSACTIONSZero Or More
STAFF_MENU_ASSIGNMENTSNon IdentifyingSTAFFMENU_ASSIGNMENTSZero Or More
STAFF_OPPORTUNITY_HISTNon IdentifyingSTAFFOPPORTUNITY_HISTZero Or More
STAFF_PROFILE_FORMSNon IdentifyingSTAFFPROFILE_FORMSZero Or More
STAFF_STOCK_REQUESTSNon IdentifyingSTAFFSTOCK_REQUESTSZero Or More
STAFF_STOCK_TRANS_HDRNon IdentifyingSTAFFSTOCK_TRANS_HDRZero Or More
STAFF_TASKSNon IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS1Non IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS2Non IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS3Non IdentifyingSTAFFTASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (EMPLOYEE_CODE)
Not NullColumn ConstraintNOT NULL (STAFFNO)
Not NullColumn ConstraintNOT NULL (SECURITYPROFILEID)
Not NullColumn ConstraintNOT NULL (ABSENT)
Not NullColumn ConstraintNOT NULL (USERPROFILEID)
Not NullColumn ConstraintNOT NULL (IS_SUPERVISOR)
Not NullColumn ConstraintNOT NULL (LOGINID)
Not NullColumn ConstraintNOT NULL (PASSWORD_CHANGED)
Not NullColumn ConstraintNOT NULL (DISCOUNTRATE)
Not NullColumn ConstraintNOT NULL (BAD_LOGIN_COUNT)
Not NullColumn ConstraintNOT NULL (ACCOUNT_STATUS)
DF__STAFF__ABSENT__12CA5E36DefaultColumn ConstraintABSENT DEFAULT N
DF__STAFF__ACCOUNT_S__5CACADF9DefaultColumn ConstraintACCOUNT_STATUS DEFAULT 0
DF__STAFF__BAD_LOGIN__5BB889C0DefaultColumn ConstraintBAD_LOGIN_COUNT DEFAULT 0
DF__STAFF__DISCOUNTR__2C146396DefaultColumn ConstraintDISCOUNTRATE DEFAULT 0
DF__STAFF__EMPLOYEE___3DB4BC3BDefaultColumn ConstraintEMPLOYEE_CODE DEFAULT -1
DF__STAFF__HAS_BUDGE__6855017DDefaultColumn ConstraintHAS_BUDGETS DEFAULT N
DF__STAFF__IS_SUPERV__24F33012DefaultColumn ConstraintIS_SUPERVISOR DEFAULT N
DF__STAFF__PASSWORD___5AC46587DefaultColumn ConstraintPASSWORD_CHANGED DEFAULT getdate()
DF__STAFF__REPORTS_T__694925B6DefaultColumn ConstraintREPORTS_TO_STAFFNO DEFAULT -1
DF__STAFF__SECURITYP__58DC1D15DefaultColumn ConstraintSECURITYPROFILEID DEFAULT 0
DF__STAFF__SMTP_SEQN__6B667852DefaultColumn ConstraintSMTP_SEQNO DEFAULT -1
DF__STAFF__USERPROFI__59D0414EDefaultColumn ConstraintUSERPROFILEID DEFAULT 0
MENU_COLLECTION_STAFFForeign KeyTable ConstraintFOREIGN KEY (MENU_NO) REFERENCES MENU_COLLECTION(SEQNO)
PK_STAFFPrimary KeyTable ConstraintPRIMARY KEY (STAFFNO)



Entity: STOCK_ITEMS
CommentThis table contains details of all stock items.
Primary key columnsSTOCKCODE

Attributes:
Column namePrimary keyData typeNot NULLComment
STOCKCODEYesVARCHAR(23)YesA unique ID code for the stock item.
DESCRIPTIONNoVARCHAR(40)NoThe stock item's description.
STOCKGROUPNoINTEGERNoThe Primary (Fine) Stock Group that the item belongs to.
STATUSNoCHAR(1)NoThe stock item's status. Will be one of:
S = Stock item
L = Lookup item
SELLPRICE1NoFLOAT(53)NoSell price 1.
SELLPRICE2NoFLOAT(53)NoSell price 2.
SELLPRICE3NoFLOAT(53)NoSell price 3.
SELLPRICE4NoFLOAT(53)NoSell price 4.
SELLPRICE5NoFLOAT(53)NoSell price 5.
SELLPRICE6NoFLOAT(53)NoSell price 6.
SELLPRICE7NoFLOAT(53)NoSell price 7.
SELLPRICE8NoFLOAT(53)NoSell price 8.
SELLPRICE9NoASNoSell price 9.
SELLPRICE10NoFLOAT(53)NoSell price 10.
LATESTCOSTNoFLOAT(53)NoThe stock item's Last Cost Price.
AVECOSTNoFLOAT(53)NoThe stock item's Average Cost Price.
MINSTOCKNoFLOAT(53)NoThe minimum default stock level for each location.
MAXSTOCKNoFLOAT(53)NoThe maximum default stock level for each location.
SUPPLIERNONoINTEGERNoThe ID number (CR_ACCS.ACCNO) of the stock item's main supplier.
MONTHUNITSNoFLOAT(53)NoSales totals in terms of quantity for the current month.
YEARUNITSNoFLOAT(53)NoYear to date sales totals in terms of quantity.
LASTYEARUNITSNoFLOAT(53)NoUnits of stock item sold in for the previous year.
MONTHVALUENoFLOAT(53)NoSales value for the current month.
YEARVALUENoFLOAT(53)NoSales value for the current year.
LASTYEARVALUENoFLOAT(53)NoSales value for last year.
BINCODENoVARCHAR(12)NoBincode for the stock item.
DISCOUNTLEVELNoINTEGERNo
DEFDAYSNoINTEGERNo
BARCODE1NoVARCHAR(30)NoBarcode/alternate code 1.
BARCODE2NoVARCHAR(30)NoBarcode/alternate code 2.
BARCODE3NoVARCHAR(30)NoBarcode/alternate code 3.
LASTMONTHVALUENoFLOAT(53)NoSales value for the previous month for the stock item.
LASTMONTHUNITSNoFLOAT(53)NoUnits of stock item sold in the previous month.
SALES_GL_CODENoINTEGERNoThe default GL code that sales transactions for this stock item are posted to.
PURCH_GL_CODENoINTEGERNoThe GL code that purchase transactions for this stock are posted to.
WEB_SHOWNoCHAR(1)No
ISACTIVENoCHAR(1)NoIf this field is set to 'Y', the stock item is active.
WEIGHTNoFLOAT(53)NoPhysical weight of the stock item.
CUBICNoFLOAT(53)NoCubic weight of the item.
ALERTNoVARCHAR(60)NoText of the pop-up alert message that appears when the stock item is sold or purchased.
NOTESNoVARCHAR(4096)NoAny notes for the stock item.
PQTYNoFLOAT(53)No
PACKNoVARCHAR(10)NoDescribes the unit of sale for pricing, e.g. EACH or PACK.
HAS_SNNoCHAR(1)NoThis field is set to 'Y' if the stock item is serial number tracked.
STDCOSTNoFLOAT(53)NoThe stock item's standard cost.
SUPPLIERNO2NoINTEGERNoAlternate supplier for the stock item.
SUPPLIERNO3NoINTEGERNoAlternate supplier for the stock item.
SALES_GLSUBCODENoINTEGERNoThe default GL sub-account code that sales transactions for this stock item are posted to.
PURCH_GLSUBCODENoINTEGERNoThe default GL sub-account code that purchase transactions for this stock item are posted to.
BRANCHNONoINTEGERNoBranch number for the stock item.
SALESTAXRATENoINTEGERNoDefault GST rate for sales transactions.
PURCHTAXRATENoINTEGERNoDefault GST rate for purchase transactions.
LAST_UPDATEDNoDATETIMENoDate and time when the stock item record was last updated.
UPDATEITEM_CODENoVARCHAR(23)NoOnly applies to lookup items. The ID number of the stocked item that maintains the actual stock.
UPDATEITEM_QTYNoFLOAT(53)NoOnly applies to lookup items. Quantity of the stocked item.
COS_GL_CODENoINTEGERNoThe Cost of Sales account updated in the General Ledger when this stock item is sold.
COS_GLSUBCODENoINTEGERNoThe Cost of Sales sub-account updated in the General Ledger when the stock item is sold.
STOCKPRICEGROUPNoINTEGERNoThe price group that the stock item belongs to.
SUPPLIERCOSTNoFLOAT(53)YesThe supplier cost price.
ECONORDERQTYNoFLOAT(53)NoThe economic order quantity (EOQ) for the stock item.
LINKED_BILLCODENoVARCHAR(23)No
STOCK_CLASSIFICATIONNoINTEGERYesThe stock classification that the item belongs to.
STOCKGROUP2NoINTEGERNoThe stock item's Secondary (Coarse) Stock Group.
TOTALSTOCKNoFLOAT(53)YesTotal units of stock for the item.
HAS_BNNoCHAR(1)NoThis field is set to 'Y' if the stock item is batch tracked.
HAS_EXPIRYNoCHAR(1)YesThis field is set to 'Y' if the stock item has an expiry date. This flag is only available in the UI if the "Use expiry dates for batched & serial numbers" profile setting is enabled.
EXPIRY_DAYSNoINTEGERNoNumber of days before expiry of the stock item.
DUTYNoFLOAT(53)YesThe duty percentage on the stock item.
SERIALNO_TYPENoINTEGERYesHow the stock item is serialised. Will be one of:
0 = Not Serialised
1 = Fully Tracked (In & Internal & Out)
2 = Creditor & Internal (In & Internal)
3 = Debtor Only (Out only)
4 = Creditor & Debtor (In & Out Only)
5 = Creditor Only (In Only)
6 = Internal & Debtor (Internal & Out only)
7 = Internal Only
COSTTYPENoINTEGERYes
COSTGROUPNoINTEGERYes
LABEL_QTYNoINTEGERYes
IS_DISCOUNTABLENoCHAR(1)YesThis field is set to 'Y' if the stock item is discountable.
RESTRICTED_ITEMNoCHAR(1)YesThis field is set to 'Y' if the stock item is a restricted item.
NUMDECIMALSNoINTEGERYesThe number of decimal places that can be entered for the stock item's quantity.
COGSMETHODNoINTEGERYes
DEFAULTWARRANTYNONoINTEGERYesThe default Warranty No for the stock item.
DIMENSIONSNoINTEGERYesHow the dimensions of the stock item are specified. Will be one of:
0=None
1=Length
2=Square
3=Cubic
X_SIZEIDNoINTEGERNoStyle size ID of the stock item. Used by the Style, Size Colour functionality.
X_COLOURIDNoINTEGERNoStyle colour ID of the stock item. Used by the Style, Size Colour functionality.
AUTO_NARRATIVENoINTEGERNoThe setting of the stock item's Auto Narrative property. Will be one of:
0=No
1=Yes with Blank
2=Yes with Notes
VARIABLECOSTNoCHAR(1)YesThe field is set to 'Y for Variable Cost stock items.
PRICEQTYNoFLOAT(53)NoThe stock item's sell price per quantity.
PRICEPERKGNoFLOAT(53)NoThe stock item's sell price per kg.
LOOKUP_RECOVERABLENoCHAR(1)NoIf this field contains 'Y', the stock item is a recoverable expense in EXO Job Costing.

Relationships:
NameRelationship typeParentChildCardinality
CR_ACCS_STOCK_ITEMSNon IdentifyingCR_ACCSSTOCK_ITEMSZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_ITEMS_STOCK_ITEMSNon IdentifyingSTOCK_ITEMSCRM_BUDGET_EXCLUDED_STOCK_ITEMSZero Or More
FK_CRM_BUDGET_LINE_STOCK_ITEMSNon IdentifyingSTOCK_ITEMSCRM_BUDGET_LINEZero Or More
GLACCS_STOCK_ITEMSNon IdentifyingGLACCSSTOCK_ITEMSZero Or More
GLACCS_STOCK_ITEMS_COSNon IdentifyingGLACCSSTOCK_ITEMSZero Or More
GL_ACCS_STOCKITEMS_PONon IdentifyingGLACCSSTOCK_ITEMSZero Or More
STOCK_CLASSIFICATIONS_STOCK_ITEMSNon IdentifyingSTOCK_CLASSIFICATIONSSTOCK_ITEMSZero Or More
STOCK_GROUP2S_STOCK_ITEMSNon IdentifyingSTOCK_GROUP2SSTOCK_ITEMSZero Or More
STOCK_GROUPS_STOCK_ITEMSNon IdentifyingSTOCK_GROUPSSTOCK_ITEMSZero Or More
STOCK_ITEMS_BILLOMAT_LINESNon IdentifyingSTOCK_ITEMSBILLOMAT_LINESZero Or More
STOCK_ITEMS_BILLOMAT_TEMPNon IdentifyingSTOCK_ITEMSBILLOMAT_TEMPZero Or More
STOCK_ITEMS_CR_INVLINESNon IdentifyingSTOCK_ITEMSCR_INVLINESZero Or More
STOCK_ITEMS_DR_INVLINESNon IdentifyingSTOCK_ITEMSDR_INVLINESOne Or More
STOCK_ITEMS_DR_PRICESNon IdentifyingSTOCK_ITEMSDR_PRICESZero Or More
STOCK_ITEMS_INWARDS_GOODS_LINESNon IdentifyingSTOCK_ITEMSINWARDS_GOODS_LINESZero Or More
STOCK_ITEMS_JOBCOST_LINESNon IdentifyingSTOCK_ITEMSJOBCOST_LINESZero Or More
STOCK_ITEMS_JOBCOST_LINES_DESCNon IdentifyingSTOCK_ITEMSJOBCOST_LINESZero Or More
STOCK_ITEMS_JOB_CONTRACT_BILLINGSNon IdentifyingSTOCK_ITEMSJOB_CONTRACT_BILLINGSZero Or More
STOCK_ITEMS_JOB_OUTPUT_ITEMSNon IdentifyingSTOCK_ITEMSJOB_OUTPUT_ITEMSZero Or More
STOCK_ITEMS_JOB_OUTPUT_ITEMS_DESCNon IdentifyingSTOCK_ITEMSJOB_OUTPUT_ITEMSZero Or More
STOCK_ITEMS_JOB_TIMESHEETSNon IdentifyingSTOCK_ITEMSJOB_TIMESHEETSZero Or More
STOCK_ITEMS_JOB_TRANSACTIONSNon IdentifyingSTOCK_ITEMSJOB_TRANSACTIONSZero Or More
STOCK_ITEMS_JOB_TRANSACTIONS_DESCNon IdentifyingSTOCK_ITEMSJOB_TRANSACTIONSZero Or More
STOCK_ITEMS_OPPORTUNITY_QUOTENon IdentifyingSTOCK_ITEMSOPPORTUNITY_QUOTEZero Or More
STOCK_ITEMS_STOCKREQUIREMENTNon IdentifyingSTOCK_ITEMSSTOCKREQUIREMENTZero Or More
STOCK_ITEMS_STOCKTAKE_TOTALSNon IdentifyingSTOCK_ITEMSSTOCKTAKE_TOTALSZero Or More
STOCK_ITEMS_STOCKTAKE_TOTALS_BNNon IdentifyingSTOCK_ITEMSSTOCKTAKE_TOTALSZero Or More
STOCK_ITEMS_STOCKTAKE_TOTALS_EXPDAYSNon IdentifyingSTOCK_ITEMSSTOCKTAKE_TOTALSZero Or More
STOCK_ITEMS_STOCKTAKE_TOTALS_EXPIRYNon IdentifyingSTOCK_ITEMSSTOCKTAKE_TOTALSZero Or More
STOCK_ITEMS_STOCKTAKE_TOTALS_SERIALNon IdentifyingSTOCK_ITEMSSTOCKTAKE_TOTALSZero Or More
STOCK_ITEMS_STOCK_LOC_INFOIdentifyingSTOCK_ITEMSSTOCK_LOC_INFOZero Or More
STOCK_ITEMS_STOCK_REQUESTLINESNon IdentifyingSTOCK_ITEMSSTOCK_REQUESTLINESZero Or More
STOCK_ITEMS_STOCK_REQUESTLINES_DESCNon IdentifyingSTOCK_ITEMSSTOCK_REQUESTLINESZero Or More
STOCK_ITEMS_STOCK_SERIALNOSNon IdentifyingSTOCK_ITEMSSTOCK_SERIALNOSZero Or More
STOCK_ITEMS_STOCK_TRANSNon IdentifyingSTOCK_ITEMSSTOCK_TRANSZero Or More
STOCK_ITEMS_STOCK_WEBNon IdentifyingSTOCK_ITEMSSTOCK_WEBZero Or More
STOCK_ITEMS_SUPPLIER_STOCK_ITEMSNon IdentifyingSTOCK_ITEMSSUPPLIER_STOCK_ITEMSZero Or More
STOCK_PRICEGROUPS_STOCK_ITEMSNon IdentifyingSTOCK_PRICEGROUPSSTOCK_ITEMSZero Or More

Indexes:
NameIndex columnsIndex type
STOCK_ITEMS_DESCDESCRIPTION ASC

Constraints:
NameTypeLevelConstraint
DefaultColumn ConstraintLOOKUP_RECOVERABLE DEFAULT Y
Not NullColumn ConstraintNOT NULL (STOCKCODE)
Not NullColumn ConstraintNOT NULL (VARIABLECOST)
Not NullColumn ConstraintNOT NULL (DIMENSIONS)
Not NullColumn ConstraintNOT NULL (DEFAULTWARRANTYNO)
Not NullColumn ConstraintNOT NULL (COGSMETHOD)
Not NullColumn ConstraintNOT NULL (NUMDECIMALS)
Not NullColumn ConstraintNOT NULL (RESTRICTED_ITEM)
Not NullColumn ConstraintNOT NULL (IS_DISCOUNTABLE)
Not NullColumn ConstraintNOT NULL (LABEL_QTY)
Not NullColumn ConstraintNOT NULL (COSTGROUP)
Not NullColumn ConstraintNOT NULL (COSTTYPE)
Not NullColumn ConstraintNOT NULL (SERIALNO_TYPE)
Not NullColumn ConstraintNOT NULL (DUTY)
Not NullColumn ConstraintNOT NULL (HAS_EXPIRY)
Not NullColumn ConstraintNOT NULL (TOTALSTOCK)
Not NullColumn ConstraintNOT NULL (STOCK_CLASSIFICATION)
Not NullColumn ConstraintNOT NULL (SUPPLIERCOST)
CR_ACCS_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (SUPPLIERNO) REFERENCES CR_ACCS(ACCNO)
DF__STOCK_ITEM__DUTY__675F4696DefaultColumn ConstraintDUTY DEFAULT 0
DF__STOCK_ITEM__PQTY__7C255952DefaultColumn ConstraintPQTY DEFAULT 1
DF__STOCK_ITE__AUTO___43ECB87EDefaultColumn ConstraintAUTO_NARRATIVE DEFAULT 0
DF__STOCK_ITE__AVECO__18A19C6FDefaultColumn ConstraintAVECOST DEFAULT 0
DF__STOCK_ITE__BRANC__5FD33367DefaultColumn ConstraintBRANCHNO DEFAULT 0
DF__STOCK_ITE__COGSM__0BD27C8DDefaultColumn ConstraintCOGSMETHOD DEFAULT 0
DF__STOCK_ITE__COSTG__50BBD860DefaultColumn ConstraintCOSTGROUP DEFAULT 0
DF__STOCK_ITE__COSTT__4FC7B427DefaultColumn ConstraintCOSTTYPE DEFAULT 0
DF__STOCK_ITE__COS_G__4D7F7902DefaultColumn ConstraintCOS_GL_CODE DEFAULT 0
DF__STOCK_ITE__COS_G__4E739D3BDefaultColumn ConstraintCOS_GLSUBCODE DEFAULT 0
DF__STOCK_ITE__CUBIC__45C948A1DefaultColumn ConstraintCUBIC DEFAULT 0
DF__STOCK_ITE__DEFAU__6F0133B5DefaultColumn ConstraintDEFAULTWARRANTYNO DEFAULT -1
DF__STOCK_ITE__DEFDA__2D9CB955DefaultColumn ConstraintDEFDAYS DEFAULT 0
DF__STOCK_ITE__DIMEN__3CFFC3CDDefaultColumn ConstraintDIMENSIONS DEFAULT 0
DF__STOCK_ITE__DISCO__2CA8951CDefaultColumn ConstraintDISCOUNTLEVEL DEFAULT 0
DF__STOCK_ITE__EXPIR__666B225DDefaultColumn ConstraintEXPIRY_DAYS DEFAULT 1
DF__STOCK_ITE__HAS_B__526429B0DefaultColumn ConstraintHAS_BN DEFAULT N
DF__STOCK_ITE__HAS_E__6576FE24DefaultColumn ConstraintHAS_EXPIRY DEFAULT N
DF__STOCK_ITE__HAS_S__7FF5EA36DefaultColumn ConstraintHAS_SN DEFAULT N
DF__STOCK_ITE__ISACT__74B941B4DefaultColumn ConstraintISACTIVE DEFAULT Y
DF__STOCK_ITE__IS_DI__3044E72DDefaultColumn ConstraintIS_DISCOUNTABLE DEFAULT Y
DF__STOCK_ITE__LABEL__6C04CB79DefaultColumn ConstraintLABEL_QTY DEFAULT 1
DF__STOCK_ITE__LASTM__2E90DD8EDefaultColumn ConstraintLASTMONTHVALUE DEFAULT 0
DF__STOCK_ITE__LASTM__2F8501C7DefaultColumn ConstraintLASTMONTHUNITS DEFAULT 0
DF__STOCK_ITE__LASTY__28D80438DefaultColumn ConstraintLASTYEARUNITS DEFAULT 0
DF__STOCK_ITE__LASTY__2BB470E3DefaultColumn ConstraintLASTYEARVALUE DEFAULT 0
DF__STOCK_ITE__LATES__17AD7836DefaultColumn ConstraintLATESTCOST DEFAULT 0
DF__STOCK_ITE__MAXST__25077354DefaultColumn ConstraintMAXSTOCK DEFAULT 0
DF__STOCK_ITE__MINST__24134F1BDefaultColumn ConstraintMINSTOCK DEFAULT 0
DF__STOCK_ITE__MONTH__26EFBBC6DefaultColumn ConstraintMONTHUNITS DEFAULT 0
DF__STOCK_ITE__MONTH__29CC2871DefaultColumn ConstraintMONTHVALUE DEFAULT 0
DF__STOCK_ITE__NUMDE__0801EBA9DefaultColumn ConstraintNUMDECIMALS DEFAULT -1
DF__STOCK_ITE__PURCH__451F3D2BDefaultColumn ConstraintPURCH_GLSUBCODE DEFAULT 0
DF__STOCK_ITE__PURCH__4727812EDefaultColumn ConstraintPURCH_GL_CODE DEFAULT 0
DF__STOCK_ITE__PURCH__68687968DefaultColumn ConstraintPURCHTAXRATE DEFAULT -1
DF__STOCK_ITE__RESTR__77CB83E0DefaultColumn ConstraintRESTRICTED_ITEM DEFAULT N
DF__STOCK_ITE__SALES__442B18F2DefaultColumn ConstraintSALES_GLSUBCODE DEFAULT 0
DF__STOCK_ITE__SALES__46335CF5DefaultColumn ConstraintSALES_GL_CODE DEFAULT 0
DF__STOCK_ITE__SALES__6774552FDefaultColumn ConstraintSALESTAXRATE DEFAULT -1
DF__STOCK_ITE__SELLP__13DCE752DefaultColumn ConstraintSELLPRICE1 DEFAULT 0
DF__STOCK_ITE__SELLP__14D10B8BDefaultColumn ConstraintSELLPRICE2 DEFAULT 0
DF__STOCK_ITE__SELLP__15C52FC4DefaultColumn ConstraintSELLPRICE3 DEFAULT 0
DF__STOCK_ITE__SELLP__16B953FDDefaultColumn ConstraintSELLPRICE4 DEFAULT 0
DF__STOCK_ITE__SELLP__39987BE6DefaultColumn ConstraintSELLPRICE5 DEFAULT 0
DF__STOCK_ITE__SELLP__3A8CA01FDefaultColumn ConstraintSELLPRICE6 DEFAULT 0
DF__STOCK_ITE__SELLP__3B80C458DefaultColumn ConstraintSELLPRICE7 DEFAULT 0
DF__STOCK_ITE__SELLP__3C74E891DefaultColumn ConstraintSELLPRICE8 DEFAULT 0
DF__STOCK_ITE__SELLP__3E5D3103DefaultColumn ConstraintSELLPRICE10 DEFAULT 0
DF__STOCK_ITE__SERIA__1C481021DefaultColumn ConstraintSERIALNO_TYPE DEFAULT 0
DF__STOCK_ITE__STATU__12E8C319DefaultColumn ConstraintSTATUS DEFAULT L
DF__STOCK_ITE__STDCO__392E6792DefaultColumn ConstraintSTDCOST DEFAULT 0
DF__STOCK_ITE__STOCK__11F49EE0DefaultColumn ConstraintSTOCKGROUP DEFAULT 0
DF__STOCK_ITE__STOCK__4F87BD05DefaultColumn ConstraintSTOCKGROUP2 DEFAULT 0
DF__STOCK_ITE__STOCK__6442E2C9DefaultColumn ConstraintSTOCK_CLASSIFICATION DEFAULT 0
DF__STOCK_ITE__STOCK__69279377DefaultColumn ConstraintSTOCKPRICEGROUP DEFAULT 0
DF__STOCK_ITE__SUPPL__16B953FDDefaultColumn ConstraintSUPPLIERCOST DEFAULT 0
DF__STOCK_ITE__SUPPL__25FB978DDefaultColumn ConstraintSUPPLIERNO DEFAULT 0
DF__STOCK_ITE__TOTAL__51700577DefaultColumn ConstraintTOTALSTOCK DEFAULT 0
DF__STOCK_ITE__UPDAT__257187A8DefaultColumn ConstraintUPDATEITEM_QTY DEFAULT 0
DF__STOCK_ITE__VARIA__611DF409DefaultColumn ConstraintVARIABLECOST DEFAULT N
DF__STOCK_ITE__WEB_S__44160A59DefaultColumn ConstraintWEB_SHOW DEFAULT N
DF__STOCK_ITE__WEIGH__44D52468DefaultColumn ConstraintWEIGHT DEFAULT 0
DF__STOCK_ITE__X_COL__02890975DefaultColumn ConstraintX_COLOURID DEFAULT 0
DF__STOCK_ITE__X_SIZ__0194E53CDefaultColumn ConstraintX_SIZEID DEFAULT 0
DF__STOCK_ITE__YEARU__27E3DFFFDefaultColumn ConstraintYEARUNITS DEFAULT 0
DF__STOCK_ITE__YEARV__2AC04CAADefaultColumn ConstraintYEARVALUE DEFAULT 0
GLACCS_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (SALES_GL_CODE) REFERENCES GLACCS(ACCNO)
GLACCS_STOCK_ITEMS_COSForeign KeyTable ConstraintFOREIGN KEY (COS_GL_CODE) REFERENCES GLACCS(ACCNO)
GL_ACCS_STOCKITEMS_POForeign KeyTable ConstraintFOREIGN KEY (PURCH_GL_CODE) REFERENCES GLACCS(ACCNO)
PK__STOCK_ITEMS__11007AA7Primary KeyTable ConstraintPRIMARY KEY (STOCKCODE)
STOCK_CLASSIFICATIONS_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCK_CLASSIFICATION) REFERENCES STOCK_CLASSIFICATIONS(CLASSNO)
STOCK_GROUP2S_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCKGROUP2) REFERENCES STOCK_GROUP2S(GROUPNO)
STOCK_GROUPS_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCKGROUP) REFERENCES STOCK_GROUPS(GROUPNO)
STOCK_PRICEGROUPS_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCKPRICEGROUP) REFERENCES STOCK_PRICEGROUPS(GROUPNO)

Triggers:
Trigger nameCode
AFTER_STOCK_ITEMS_DELETECREATE TRIGGER [dbo].[AFTER_STOCK_ITEMS_DELETE] ON [dbo].[STOCK_ITEMS]
FOR DELETE
AS
SET NOCOUNT ON
  DELETE FROM STOCK_LOC_INFO WHERE STOCKCODE IN (SELECT STOCKCODE FROM DELETED)
SET NOCOUNT OFF
STOCK_ITEMS_LOC_INFOCREATE TRIGGER [dbo].[STOCK_ITEMS_LOC_INFO] ON [dbo].[STOCK_ITEMS]
FOR INSERT
AS
BEGIN
  SET NOCOUNT ON
  INSERT INTO STOCK_LOC_INFO
    (STOCKCODE, LOCATION, BINCODE, MINSTOCK, MAXSTOCK, QTY)
  SELECT I.STOCKCODE, SL.LOCNO, I.BINCODE, I.MINSTOCK, I.MAXSTOCK, 0
  FROM STOCK_LOCATIONS SL, INSERTED I
  SET NOCOUNT OFF
END
STOCK_ITEMS_ONEOFFCREATE TRIGGER [dbo].[STOCK_ITEMS_ONEOFF] ON [dbo].[STOCK_ITEMS]
FOR UPDATE
AS
BEGIN
  DECLARE @UPDATEDLINES INT
  SET @UPDATEDLINES=@@ROWCOUNT
  SET NOCOUNT ON
  IF (@UPDATEDLINES > 0) AND NOT UPDATE(ISACTIVE)
    BEGIN
    UPDATE S
    SET ISACTIVE = 'N'
    FROM [dbo].[STOCK_ITEMS] S
    JOIN INSERTED I ON S.STOCKCODE = I.STOCKCODE
    JOIN STOCK_TRANS ST ON I.STOCKCODE = ST.STOCKCODE
    WHERE ((S.STOCK_CLASSIFICATION = 100) OR (S.STOCK_CLASSIFICATION = 70))
    AND (S.TOTALSTOCK <= 0)
    END
  SET NOCOUNT OFF
END