
IF NOT EXISTS (SELECT 1 FROM pal_SurfaceField WHERE surfaceFieldName = 'OrderCalculationsandProducts_OrderCalculations_WholesalerOffersDelivery')
BEGIN

SET IDENTITY_INSERT [dbo].[pal_SurfaceField] ON 
INSERT INTO [dbo].[pal_SurfaceField]
([recId]
,[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
(3220,
3094,
N'OrderCalculationsandProducts_OrderCalculations_WholesalerOffersDelivery',
N'Wholesaler Offers Delivery',
8,
0,
0,
0,
'',
'',
'',
'',
'',
3141,
0,
1,
0,
0,
0,
0,
0,
0,
'',
'',
0,
1,
0,
'',
0,
0,
0,
0,
0,	
0,
0,
0,
0,
'',
3,
1,
0,
12,
0,
1,
0,
0,
'',
0,
0,
0,
0,
0,
0,
0,
0,
'',
0);

SET IDENTITY_INSERT [dbo].[pal_SurfaceField] OFF 
END;

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

ALTER TABLE [dbo].[publ_WholesalerOrders]
ADD [OrderCalculationsandProducts_OrderCalculations_WholesalerOffersDelivery] [bit] NULL;

UPDATE [dbo].[publ_WholesalerOrders]
SET [OrderCalculationsandProducts_OrderCalculations_WholesalerOffersDelivery] = 0
WHERE [OrderCalculationsandProducts_OrderCalculations_WholesalerOffersDelivery] is null;

END;