USE [cloudERP]
GO
/****** Object:  Table [db_masters].[emp_referals]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_masters].[emp_referals](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[empid] [bigint] NULL,
	[name] [varchar](200) NULL,
	[organization] [varchar](200) NULL,
	[contactno] [varchar](200) NULL,
	[email] [varchar](100) NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
 CONSTRAINT [PK_emp_referals] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mktg].[dtl_qoute_pi_levies_revised]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mktg].[dtl_qoute_pi_levies_revised](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[piid] [bigint] NOT NULL,
	[revisedno] [int] NULL,
	[levyid] [int] NOT NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
 CONSTRAINT [PK_dtl_qoute_pi_levies_revised] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mktg].[dtl_quote_pi_revised]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mktg].[dtl_quote_pi_revised](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[piid] [bigint] NOT NULL,
	[revisedno] [int] NULL,
	[itemid] [bigint] NOT NULL,
	[billingdescription] [varchar](200) NULL,
	[uom] [varchar](15) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[mrp] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[netrate] [decimal](13, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 3) NULL,
	[totalamt] [decimal](13, 2) NULL,
	[remarks] [varchar](100) NULL,
	[focqty] [decimal](15, 3) NULL,
	[hsnid] [int] NULL,
 CONSTRAINT [PK_dtl_quote_pi_revised] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mktg].[dtl_quote_revised]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mktg].[dtl_quote_revised](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[quoteid] [bigint] NOT NULL,
	[revisedno] [int] NULL,
	[itemid] [bigint] NOT NULL,
	[billingdescription] [varchar](200) NULL,
	[isfoc] [bit] NULL,
	[issample] [bit] NULL,
	[specialcode] [varchar](50) NULL,
	[packing] [varchar](25) NULL,
	[uom] [varchar](15) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[mrp] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[netrate] [decimal](13, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 3) NULL,
	[totalamt] [decimal](13, 2) NULL,
	[remarks] [varchar](100) NULL,
	[qtyalreadydispatched] [decimal](15, 3) NULL,
	[qtytodispatch] [decimal](15, 3) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[focqty] [decimal](15, 3) NULL,
	[itemtype] [char](1) NULL,
	[hsnid] [int] NULL,
	[itemdiscpercentage] [decimal](10, 3) NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mktg].[quote_documentsreqd_revised]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mktg].[quote_documentsreqd_revised](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[quoteid] [int] NOT NULL,
	[revisedno] [int] NULL,
	[srno] [int] NULL,
	[documentid] [int] NOT NULL,
	[documentinfo] [varchar](300) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mktg].[quote_pi_paymentterms_revised]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mktg].[quote_pi_paymentterms_revised](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[piid] [bigint] NULL,
	[srno] [int] NULL,
	[revisedno] [int] NULL,
	[paymenttermid] [int] NULL,
	[paymentterm] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[percent] [decimal](6, 2) NULL,
	[amount] [decimal](15, 5) NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mktg].[quote_pi_termsandconditions_revised]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mktg].[quote_pi_termsandconditions_revised](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[piid] [bigint] NULL,
	[srno] [int] NULL,
	[revisedno] [int] NULL,
	[termsandconditionsid] [int] NOT NULL,
	[termsandcondition] [varchar](max) NULL,
	[createdby] [bigint] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
 CONSTRAINT [PK_quote_pi_termsandconditions_revised] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mm].[dtl_grn_levies]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mm].[dtl_grn_levies](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[grnid] [int] NOT NULL,
	[levyid] [int] NOT NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
 CONSTRAINT [PK_dtl_grn_levies] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mm].[mst_advicetypemaster]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mm].[mst_advicetypemaster](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[type] [varchar](100) NOT NULL,
	[boid] [int] NOT NULL,
	[coid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
 CONSTRAINT [PK_mst_advicetypemaster] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[dtl_mo]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[dtl_mo](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[moid] [bigint] NULL,
	[moteamtype] [char](1) NULL,
	[moassignedteamid] [int] NULL,
	[mostartdate] [date] NULL,
	[mostarttime] [time](7) NULL,
	[molbr] [int] NULL,
	[moparts] [int] NULL,
	[mooutsidelbr] [int] NULL,
	[moteamremarks] [nvarchar](1000) NULL,
	[moteamenddate] [date] NULL,
	[moteamendtime] [time](7) NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[hdr_mo]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [db_mt].[hdr_mo](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[mono] [bigint] NULL,
	[modate] [date] NULL,
	[motime] [time](7) NULL,
	[mtid] [bigint] NULL,
	[motemplateid] [int] NULL,
	[mopriorityid] [smallint] NULL,
	[moqueueno] [bigint] NULL,
	[mostartdate] [datetime] NULL,
	[moenddate] [datetime] NULL,
	[mostatusid] [int] NULL,
	[mototaldowntimehours] [int] NULL,
	[modowntimemins] [int] NULL,
	[mototlbr] [int] NULL,
	[mototparts] [int] NULL,
	[mototoutsidelbr] [int] NULL,
	[motottimetakenhours] [int] NULL,
	[motottimetakenmins] [int] NULL,
	[morootcauseid] [int] NULL,
	[moremarks] [nvarchar](1000) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [db_mt].[mst_Frequency]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[mst_Frequency](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[freqname] [varchar](250) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[mst_mostatus]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[mst_mostatus](
	[id] [smallint] IDENTITY(1,1) NOT NULL,
	[mtstatus] [varchar](50) NULL,
	[mostatus] [varchar](50) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[mst_mt_team]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[mst_mt_team](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[teamleaderid] [bigint] NULL,
	[teamname] [varchar](200) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[isactive] [bit] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[mst_Priority]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[mst_Priority](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[mtpriority] [varchar](250) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[mst_rootcause]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[mst_rootcause](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[rootcause] [varchar](250) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[mst_ticket_images]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[mst_ticket_images](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[mtno] [bigint] NOT NULL,
	[srno] [int] NULL,
	[imageinfo] [varchar](300) NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[filename] [varchar](200) NULL,
 CONSTRAINT [PK_mst_ticket_images] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_mt].[tickets]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_mt].[tickets](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[mtno] [bigint] NOT NULL,
	[mtdate] [date] NULL,
	[mttime] [time](7) NULL,
	[mtduedate] [date] NULL,
	[mtduetime] [time](7) NULL,
	[mtmoid] [bigint] NULL,
	[mttype] [char](1) NULL,
	[mtcatg] [char](1) NULL,
	[mttempid] [bigint] NULL,
	[mtdeptid] [int] NULL,
	[mtassetid] [bigint] NULL,
	[mtassetlocation] [varchar](100) NULL,
	[mtfreqid] [smallint] NULL,
	[mtpriorityid] [smallint] NULL,
	[mtownerid] [bigint] NULL,
	[mtstatusid] [smallint] NULL,
	[mtlastmaintdate] [date] NULL,
	[mtproblem] [nvarchar](1000) NULL,
	[mtdelaydays] [smallint] NULL,
	[mtdocuploaded] [bit] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_sop].[dtl_drcrnote]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [db_sop].[dtl_drcrnote](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[noteid] [int] NULL,
	[itemid] [int] NOT NULL,
	[billedqty] [decimal](18, 0) NOT NULL,
	[noteqty] [decimal](18, 0) NOT NULL,
	[rate] [decimal](18, 0) NOT NULL,
	[taxableamt] [decimal](18, 0) NOT NULL,
	[gstid] [int] NOT NULL,
	[igst] [decimal](18, 0) NOT NULL,
	[sgst] [decimal](18, 0) NOT NULL,
	[cgst] [decimal](18, 0) NOT NULL,
	[igstamt] [decimal](18, 0) NOT NULL,
	[sgstamt] [decimal](18, 0) NOT NULL,
	[cgstamt] [decimal](18, 0) NOT NULL,
	[totalamt] [decimal](18, 0) NOT NULL,
	[notetypeid] [int] NULL,
 CONSTRAINT [PK_dtl_drcrnote] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [db_sop].[hdr_drcrnote]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_sop].[hdr_drcrnote](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[noteno] [int] NOT NULL,
	[notedate] [datetime] NOT NULL,
	[partyid] [int] NOT NULL,
	[name] [varchar](100) NOT NULL,
	[address] [varchar](300) NOT NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[country] [varchar](50) NULL,
	[gstin] [varchar](15) NULL,
	[drcr] [char](1) NOT NULL,
	[invid] [int] NOT NULL,
	[reasonid] [int] NOT NULL,
	[taxableamt] [decimal](18, 0) NOT NULL,
	[igstamt] [decimal](18, 0) NOT NULL,
	[sgstamt] [decimal](18, 0) NOT NULL,
	[cgstamt] [decimal](18, 0) NOT NULL,
	[totalamt] [decimal](18, 0) NOT NULL,
	[boid] [int] NOT NULL,
	[coid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NULL,
 CONSTRAINT [PK_hdr_drcrnote] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_sop].[mst_reasonfornote]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_sop].[mst_reasonfornote](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[code] [char](2) NOT NULL,
	[reason] [varchar](100) NOT NULL,
	[boid] [int] NOT NULL,
	[coid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
 CONSTRAINT [PK_mst_reasonfornote] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [db_sop].[order_images]    Script Date: 1/15/2020 8:47:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [db_sop].[order_images](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[orderid] [bigint] NOT NULL,
	[srno] [int] NULL,
	[filename] [varchar](200) NULL,
	[imageinfo] [varchar](300) NULL,
	[remarks] [varchar](max) NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
 CONSTRAINT [PK_sop_images] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [piid]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [revisedno]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [levyid]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [quantity]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [rate]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [uomid]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [amount]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [gstid]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [igstamt]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [cgstamt]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [sgstamt]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [igstrate]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [cgstrate]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [sgstrate]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mktg].[dtl_qoute_pi_levies_revised] ADD  DEFAULT ((0)) FOR [modifiedby]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [revisedno]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [itemid]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [gstid]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [igstrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [sgstrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [cgstrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [cessrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [basicamount]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [mrp]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [rate]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [netrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [orderedquantity]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [itemdiscpercent]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [itemdiscamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [netamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [igstamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [cgstamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [sgstamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [cessamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [totalamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_pi_revised] ADD  DEFAULT ((0)) FOR [hsnid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__quote__1162CF5F]  DEFAULT ((0)) FOR [quoteid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF_dtl_quote_revised_revisedno]  DEFAULT ((0)) FOR [revisedno]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__itemi__1256F398]  DEFAULT ((0)) FOR [itemid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__gstid__134B17D1]  DEFAULT ((0)) FOR [gstid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__igstr__6188D3B4]  DEFAULT ((0)) FOR [igstrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__sgstr__627CF7ED]  DEFAULT ((0)) FOR [sgstrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__cgstr__63711C26]  DEFAULT ((0)) FOR [cgstrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__cessr__6465405F]  DEFAULT ((0)) FOR [cessrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__basic__65596498]  DEFAULT ((0)) FOR [basicamount]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__mrp__664D88D1]  DEFAULT ((0)) FOR [mrp]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__rate__6741AD0A]  DEFAULT ((0)) FOR [rate]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__netra__6835D143]  DEFAULT ((0)) FOR [netrate]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__order__6929F57C]  DEFAULT ((0)) FOR [orderedquantity]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__itemd__6A1E19B5]  DEFAULT ((0)) FOR [itemdiscpercent]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__itemd__6B123DEE]  DEFAULT ((0)) FOR [itemdiscamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__netam__6C066227]  DEFAULT ((0)) FOR [netamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__igsta__6CFA8660]  DEFAULT ((0)) FOR [igstamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__cgsta__6DEEAA99]  DEFAULT ((0)) FOR [cgstamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__sgsta__6EE2CED2]  DEFAULT ((0)) FOR [sgstamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__cessa__6FD6F30B]  DEFAULT ((0)) FOR [cessamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__total__70CB1744]  DEFAULT ((0)) FOR [totalamt]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__qtyal__71BF3B7D]  DEFAULT ((0)) FOR [qtyalreadydispatched]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__qtyto__72B35FB6]  DEFAULT ((0)) FOR [qtytodispatch]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__coid__26A80508]  DEFAULT ((0)) FOR [coid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__boid__279C2941]  DEFAULT ((0)) FOR [boid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__fyid__28904D7A]  DEFAULT ((0)) FOR [fyid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__focqt__409C15DE]  DEFAULT ((0)) FOR [focqty]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__hsnid__298471B3]  DEFAULT ((0)) FOR [hsnid]
GO
ALTER TABLE [db_mktg].[dtl_quote_revised] ADD  CONSTRAINT [DF__dtl_quote_revised__itemd__4C03A6E9]  DEFAULT ((0)) FOR [itemdiscpercentage]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [piid]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [srno]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [revisedno]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [paymenttermid]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [modifiedby]
GO
ALTER TABLE [db_mktg].[quote_pi_paymentterms_revised] ADD  DEFAULT ((0)) FOR [amount]
GO
ALTER TABLE [db_mktg].[quote_pi_termsandconditions_revised] ADD  DEFAULT ((0)) FOR [piid]
GO
ALTER TABLE [db_mktg].[quote_pi_termsandconditions_revised] ADD  DEFAULT ((0)) FOR [srno]
GO
ALTER TABLE [db_mktg].[quote_pi_termsandconditions_revised] ADD  DEFAULT ((0)) FOR [revisedno]
GO
ALTER TABLE [db_mktg].[quote_pi_termsandconditions_revised] ADD  DEFAULT ((0)) FOR [termsandconditionsid]
GO
ALTER TABLE [db_mktg].[quote_pi_termsandconditions_revised] ADD  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mktg].[quote_pi_termsandconditions_revised] ADD  DEFAULT ((0)) FOR [modifiedby]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [grnid]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [levyid]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [quantity]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [rate]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [uomid]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [amount]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [gstid]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [igstamt]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [cgstamt]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [sgstamt]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [igstrate]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [cgstrate]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [sgstrate]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mm].[dtl_grn_levies] ADD  DEFAULT ((0)) FOR [modifiedby]
GO
ALTER TABLE [db_mt].[hdr_mo] ADD  CONSTRAINT [DF_hdr_mo_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mt].[mst_Frequency] ADD  CONSTRAINT [DF_mst_Frequency_coid]  DEFAULT ((0)) FOR [coid]
GO
ALTER TABLE [db_mt].[mst_Frequency] ADD  CONSTRAINT [DF_mst_Frequency_boid]  DEFAULT ((0)) FOR [boid]
GO
ALTER TABLE [db_mt].[mst_Frequency] ADD  CONSTRAINT [DF_mst_Frequency_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mt].[mst_mostatus] ADD  CONSTRAINT [DF_mst_mostatus_coid]  DEFAULT ((0)) FOR [coid]
GO
ALTER TABLE [db_mt].[mst_mostatus] ADD  CONSTRAINT [DF_mst_mostatus_boid]  DEFAULT ((0)) FOR [boid]
GO
ALTER TABLE [db_mt].[mst_mostatus] ADD  CONSTRAINT [DF_mst_mostatus_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mt].[mst_mt_team] ADD  CONSTRAINT [DF_mst_mt_team_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mt].[mst_Priority] ADD  CONSTRAINT [DF_mst_Priority_coid]  DEFAULT ((0)) FOR [coid]
GO
ALTER TABLE [db_mt].[mst_Priority] ADD  CONSTRAINT [DF_mst_Priority_boid]  DEFAULT ((0)) FOR [boid]
GO
ALTER TABLE [db_mt].[mst_Priority] ADD  CONSTRAINT [DF_mst_Priority_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mt].[mst_rootcause] ADD  CONSTRAINT [DF_mst_rootcause_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_mt].[tickets] ADD  CONSTRAINT [DF_tickets_mt_moid]  DEFAULT ((0)) FOR [mtmoid]
GO
ALTER TABLE [db_mt].[tickets] ADD  CONSTRAINT [DF_tickets_createdby]  DEFAULT ((0)) FOR [createdby]
GO
ALTER TABLE [db_sop].[dtl_drcrnote] ADD  DEFAULT ((0)) FOR [notetypeid]
GO
ALTER TABLE [db_sop].[hdr_drcrnote] ADD  DEFAULT ((0)) FOR [fyid]
GO
