
update pal_SurfaceField
set surfaceFieldDisplay = 'Order Placed Date'
where surfaceFieldName = 'OrderManagement_OrderManagement_OrderDate';

if((select count(*) from dbo.pal_SurfaceField where surfaceFieldName = 'OrderManagement_OrderManagement_QuoteRequestedDate') = 0)
begin
INSERT [dbo].[pal_SurfaceField] ([surfaceId], [surfaceFieldName], [surfaceFieldDisplay], [surfaceFieldTypeId], [length], [required], [lookupCategory], [relationalFields], [relationalValues], [relationalOrderBy], [relationalSurface], [relationalObject], [parentId], [sequence], [isActive], [isGrid], [isFilter], [colSequence], [contentId], [defaultToCurrent], [isControlled], [controlledValue], [controlText], [isAutoPostback], [isHidden], [isReadOnly], [placeholder], [isUnique], [actionType], [action], [actionSource], [isComparable], [alternateView], [isHiddenFromWizzard], [surfaceDateTypeId], [isHiddenFromView], [actionValue], [surfaceFieldSize], [isLabelHidden], [isOnNewLine], [labelSize], [isHiddenFromForm], [accessLevel], [hasBottomBorder], [hasFullBorder], [defaultValue], [validationType], [enableBulkUpdate], [isCurrency], [isVerticalHeader], [gridSequence], [isGrouped], [isCloneable], [isCustomSource], [relationalWhere], [groupedDisplayCount]) VALUES
(3094, N'OrderManagement_OrderManagement_QuoteRequestedDate', N'Quote Requested Date', 7, 0, 0, 0, '', '','','','', 1937, 10, 1, 0, 0, 0, 0, 0, 0, '', '', 0, 1, 1, '', 0, 0, 0, 0, 0, 0, 0, 1, 0, '', 3, 0, 0, 12, 0, 1, 0, 0, '', 0, 0, 0, 0, 5, 0, 1, 0, '', 0);
end;

if((select count(*) from dbo.pal_SurfaceField where surfaceFieldName = 'OrderManagement_OrderManagement_QuoteSubmittedDate') = 0)
begin
INSERT [dbo].[pal_SurfaceField] ([surfaceId], [surfaceFieldName], [surfaceFieldDisplay], [surfaceFieldTypeId], [length], [required], [lookupCategory], [relationalFields], [relationalValues], [relationalOrderBy], [relationalSurface], [relationalObject], [parentId], [sequence], [isActive], [isGrid], [isFilter], [colSequence], [contentId], [defaultToCurrent], [isControlled], [controlledValue], [controlText], [isAutoPostback], [isHidden], [isReadOnly], [placeholder], [isUnique], [actionType], [action], [actionSource], [isComparable], [alternateView], [isHiddenFromWizzard], [surfaceDateTypeId], [isHiddenFromView], [actionValue], [surfaceFieldSize], [isLabelHidden], [isOnNewLine], [labelSize], [isHiddenFromForm], [accessLevel], [hasBottomBorder], [hasFullBorder], [defaultValue], [validationType], [enableBulkUpdate], [isCurrency], [isVerticalHeader], [gridSequence], [isGrouped], [isCloneable], [isCustomSource], [relationalWhere], [groupedDisplayCount]) VALUES
(3094, N'OrderManagement_OrderManagement_QuoteSubmittedDate', N'Quote Submitted Date', 7, 0, 0, 0, '', '','','','', 1937, 11, 1, 0, 0, 0, 0, 0, 0, '', '', 0, 1, 1, '', 0, 0, 0, 0, 0, 0, 0, 1, 0, '', 3, 0, 0, 12, 0, 1, 0, 0, '', 0, 0, 0, 0, 5, 0, 1, 0, '', 0);
end;

if((select count(*) from dbo.pal_SurfaceField where surfaceFieldName = 'OrderManagement_OrderManagement_OrderConfirmedDate') = 0)
begin
INSERT [dbo].[pal_SurfaceField] ([surfaceId], [surfaceFieldName], [surfaceFieldDisplay], [surfaceFieldTypeId], [length], [required], [lookupCategory], [relationalFields], [relationalValues], [relationalOrderBy], [relationalSurface], [relationalObject], [parentId], [sequence], [isActive], [isGrid], [isFilter], [colSequence], [contentId], [defaultToCurrent], [isControlled], [controlledValue], [controlText], [isAutoPostback], [isHidden], [isReadOnly], [placeholder], [isUnique], [actionType], [action], [actionSource], [isComparable], [alternateView], [isHiddenFromWizzard], [surfaceDateTypeId], [isHiddenFromView], [actionValue], [surfaceFieldSize], [isLabelHidden], [isOnNewLine], [labelSize], [isHiddenFromForm], [accessLevel], [hasBottomBorder], [hasFullBorder], [defaultValue], [validationType], [enableBulkUpdate], [isCurrency], [isVerticalHeader], [gridSequence], [isGrouped], [isCloneable], [isCustomSource], [relationalWhere], [groupedDisplayCount]) VALUES
(3094, N'OrderManagement_OrderManagement_OrderConfirmedDate', N'Order Confirmed Date', 7, 0, 0, 0, '', '','','','', 1937, 12, 1, 0, 0, 0, 0, 0, 0, '', '', 0, 1, 1, '', 0, 0, 0, 0, 0, 0, 0, 1, 0, '', 3, 0, 0, 12, 0, 1, 0, 0, '', 0, 0, 0, 0, 5, 0, 1, 0, '', 0);
end;

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE
	TABLE_NAME = 'publ_WholesalerOrders' AND
	COLUMN_NAME = 'OrderManagement_OrderManagement_QuoteRequestedDate')
BEGIN

ALTER TABLE [dbo].[publ_WholesalerOrders]
ADD [OrderManagement_OrderManagement_QuoteRequestedDate] [datetime] NULL;

UPDATE [dbo].[publ_WholesalerOrders]
SET [OrderManagement_OrderManagement_QuoteRequestedDate] = ''
where [OrderManagement_OrderManagement_QuoteRequestedDate] is null;

END;

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE
	TABLE_NAME = 'publ_WholesalerOrders' AND
	COLUMN_NAME = 'OrderManagement_OrderManagement_QuoteSubmittedDate')
BEGIN

ALTER TABLE [dbo].[publ_WholesalerOrders]
ADD [OrderManagement_OrderManagement_QuoteSubmittedDate] [datetime] NULL;

UPDATE [dbo].[publ_WholesalerOrders]
SET [OrderManagement_OrderManagement_QuoteSubmittedDate] = ''
where [OrderManagement_OrderManagement_QuoteSubmittedDate] is null;

END;

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE
	TABLE_NAME = 'publ_WholesalerOrders' AND
	COLUMN_NAME = 'OrderManagement_OrderManagement_OrderConfirmedDate')
BEGIN

ALTER TABLE [dbo].[publ_WholesalerOrders]
ADD [OrderManagement_OrderManagement_OrderConfirmedDate] [datetime] NULL;

UPDATE [dbo].[publ_WholesalerOrders]
SET [OrderManagement_OrderManagement_OrderConfirmedDate] = ''
where [OrderManagement_OrderManagement_OrderConfirmedDate] is null;

END;