Tables [dbo].[ICSalesServiceLedgerDetails]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:55:54 AM Thursday, March 21, 2019
Last Modified1:12:00 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_ICSalesServiceLedgerDetails: LedgerDetailIDLedgerDetailIDint4
False
1 - 1
Foreign Keys FK_ICSalesServiceLedgerDetails_LedgerID_ICSalesServiceLedger: [dbo].[ICSalesServiceLedger].LedgerIDLedgerIDint4
False
TransactionDetailIDint4
False
Foreign Keys FK_ICSalesServiceLedgerDetails_SOID_SOOrders: [dbo].[SOOrders].SOIDSOIDint4
True
SODetailIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_ItemID_ICItems: [dbo].[ICItems].ItemIDItemIDint4
False
Quantitydecimal(18,6)9
False
QuantityExtdecimal(18,6)9
False
SerialNumbervarchar(32)32
False
Descriptionvarchar(255)255
False
Foreign Keys FK_ICSalesServiceLedgerDetails_UMID_ICUnits: [dbo].[ICUnits].UMIDUMIDint4
False
ConvFactordecimal(18,6)9
False
Pricemoney8
False
Discountmoney8
False
Billbit1
False
Amountmoney8
False
Costmoney8
False
Foreign Keys FK_ICSalesServiceLedgerDetails_EquipmentID_SCEquipments: [dbo].[SCEquipments].EquipmentIDEquipmentIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_ContractID_SCContracts: [dbo].[SCContracts].ContractIDContractIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_InvGLID_GLAccounts: [dbo].[GLAccounts].InvGLIDInvGLIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_COGSGLID_GLAccounts: [dbo].[GLAccounts].COGSGLIDCOGSGLIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_COGSDeptID_GLDepts: [dbo].[GLDepts].COGSDeptIDCOGSDeptIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_ReturnCodeID_ICReturnCodes: [dbo].[ICReturnCodes].ReturnCodeIDReturnCodeIDint4
True
ReturnRemarksvarchar(255)255
False
('')
Foreign Keys FK_ICSalesServiceLedgerDetails_StockTypeID_ICStockTypes: [dbo].[ICStockTypes].StockTypeIDStockTypeIDint4
False
((1))
OverriddenCostbit1
False
((0))
ChargeOutCostmoney8
False
((0))
GLIDint4
True
DeptIDint4
True
CalculatedOutCostmoney8
False
((0))
OutCostmoney8
False
((0))
OutCostExtendedmoney8
False
((0))
WarehouseIDint4
True
BinIDint4
True
TransactionDetailBinIDint4
True
Foreign Keys FK_ICSalesServiceLedgerDetails_ServiceItemID_ICItems: [dbo].[ICItems].ServiceItemIDServiceItemIDint4
True
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK_ICSalesServiceLedgerDetails: LedgerDetailIDPK_ICSalesServiceLedgerDetailsLedgerDetailID
True
80
NameColumns
FK_ICSalesServiceLedgerDetails_COGSDeptID_GLDeptsCOGSDeptID->[dbo].[GLDepts].[DeptID]
FK_ICSalesServiceLedgerDetails_COGSGLID_GLAccountsCOGSGLID->[dbo].[GLAccounts].[AccountID]
FK_ICSalesServiceLedgerDetails_ContractID_SCContractsContractID->[dbo].[SCContracts].[ContractID]
FK_ICSalesServiceLedgerDetails_EquipmentID_SCEquipmentsEquipmentID->[dbo].[SCEquipments].[EquipmentID]
FK_ICSalesServiceLedgerDetails_InvGLID_GLAccountsInvGLID->[dbo].[GLAccounts].[AccountID]
FK_ICSalesServiceLedgerDetails_ItemID_ICItemsItemID->[dbo].[ICItems].[ItemID]
FK_ICSalesServiceLedgerDetails_LedgerID_ICSalesServiceLedgerLedgerID->[dbo].[ICSalesServiceLedger].[LedgerID]
FK_ICSalesServiceLedgerDetails_ReturnCodeID_ICReturnCodesReturnCodeID->[dbo].[ICReturnCodes].[ReturnCodeID]
FK_ICSalesServiceLedgerDetails_ServiceItemID_ICItemsServiceItemID->[dbo].[ICItems].[ItemID]
FK_ICSalesServiceLedgerDetails_SOID_SOOrdersSOID->[dbo].[SOOrders].[SOID]
FK_ICSalesServiceLedgerDetails_StockTypeID_ICStockTypesStockTypeID->[dbo].[ICStockTypes].[StockTypeID]
FK_ICSalesServiceLedgerDetails_UMID_ICUnitsUMID->[dbo].[ICUnits].[ID]
CREATE TABLE [dbo].[ICSalesServiceLedgerDetails]
(
[LedgerDetailID] [int] NOT NULL IDENTITY(1, 1),
[LedgerID] [int] NOT NULL,
[TransactionDetailID] [int] NOT NULL,
[SOID] [int] NULL,
[SODetailID] [int] NULL,
[ItemID] [int] NOT NULL,
[Quantity] [decimal] (18, 6) NOT NULL,
[QuantityExt] [decimal] (18, 6) NOT NULL,
[SerialNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UMID] [int] NOT NULL,
[ConvFactor] [decimal] (18, 6) NOT NULL,
[Price] [money] NOT NULL,
[Discount] [money] NOT NULL,
[Bill] [bit] NOT NULL,
[Amount] [money] NOT NULL,
[Cost] [money] NOT NULL,
[EquipmentID] [int] NULL,
[ContractID] [int] NULL,
[InvGLID] [int] NULL,
[COGSGLID] [int] NULL,
[COGSDeptID] [int] NULL,
[ReturnCodeID] [int] NULL,
[ReturnRemarks] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_ReturnRemarks] DEFAULT (''),
[StockTypeID] [int] NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_StockTypeID] DEFAULT ((1)),
[OverriddenCost] [bit] NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_OverriddenCost] DEFAULT ((0)),
[ChargeOutCost] [money] NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_ChargeOutCost] DEFAULT ((0)),
[GLID] [int] NULL,
[DeptID] [int] NULL,
[CalculatedOutCost] [money] NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_CalculatedOutCost] DEFAULT ((0)),
[OutCost] [money] NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_OutCost] DEFAULT ((0)),
[OutCostExtended] [money] NOT NULL CONSTRAINT [DF_ICSalesServiceLedgerDetails_OutCostExtended] DEFAULT ((0)),
[WarehouseID] [int] NULL,
[BinID] [int] NULL,
[TransactionDetailBinID] [int] NULL,
[ServiceItemID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [PK_ICSalesServiceLedgerDetails] PRIMARY KEY CLUSTERED  ([LedgerDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_COGSDeptID_GLDepts] FOREIGN KEY ([COGSDeptID]) REFERENCES [dbo].[GLDepts] ([DeptID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_COGSGLID_GLAccounts] FOREIGN KEY ([COGSGLID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_ContractID_SCContracts] FOREIGN KEY ([ContractID]) REFERENCES [dbo].[SCContracts] ([ContractID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_EquipmentID_SCEquipments] FOREIGN KEY ([EquipmentID]) REFERENCES [dbo].[SCEquipments] ([EquipmentID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_InvGLID_GLAccounts] FOREIGN KEY ([InvGLID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_ItemID_ICItems] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[ICItems] ([ItemID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_LedgerID_ICSalesServiceLedger] FOREIGN KEY ([LedgerID]) REFERENCES [dbo].[ICSalesServiceLedger] ([LedgerID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_ReturnCodeID_ICReturnCodes] FOREIGN KEY ([ReturnCodeID]) REFERENCES [dbo].[ICReturnCodes] ([ReturnCodeID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_ServiceItemID_ICItems] FOREIGN KEY ([ServiceItemID]) REFERENCES [dbo].[ICItems] ([ItemID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_SOID_SOOrders] FOREIGN KEY ([SOID]) REFERENCES [dbo].[SOOrders] ([SOID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_StockTypeID_ICStockTypes] FOREIGN KEY ([StockTypeID]) REFERENCES [dbo].[ICStockTypes] ([StockTypeID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedgerDetails] ADD CONSTRAINT [FK_ICSalesServiceLedgerDetails_UMID_ICUnits] FOREIGN KEY ([UMID]) REFERENCES [dbo].[ICUnits] ([ID])
GO
  • [dbo].[v_ExpenseItemHistory]
  • [dbo].[v_ICItemSales]