

update pal_SurfaceField
set surfaceFieldName = 'WholesalerOrderQuoteItems_QuoteItems_RequestedUnitQuantity',
surfaceFieldDisplay = 'Requested Unit Quantity'
where recId = 1875;

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE
	TABLE_NAME = 'publ_WholesalerOrders' AND
	COLUMN_NAME = 'OrderCalculationsandProducts_OrderCalculations_OrderStep1')
BEGIN
alter table publ_WholesalerOrders
add [OrderCalculationsandProducts_OrderCalculations_OrderStep1] [nvarchar](max) NULL,
	[OrderCalculationsandProducts_OrderCalculations_OrderStep2] [nvarchar](max) NULL,
	[OrderCalculationsandProducts_OrderCalculations_OrderStep3] [nvarchar](max) NULL,
	[OrderCalculationsandProducts_OrderCalculations_OrderStep4] [nvarchar](max) NULL,
	[OrderCalculationsandProducts_WholesalerProductOrder_RetailerOrderProcess] [nvarchar](max) NULL;
END;


IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE
	TABLE_NAME = 'publ_WholesalerOrderProducts' AND
	COLUMN_NAME = 'WholesalerOrderQuoteItems_QuoteItems_Brand')
BEGIN
alter table publ_WholesalerOrderProducts
add WholesalerOrderQuoteItems_QuoteItems_Brand [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_CaseQuantity [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_Department [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_QuotedExtraGP decimal(18,2) NULL,
WholesalerOrderQuoteItems_QuoteItems_CostPrice decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_Image [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_PriceExpires datetime NULL,
WholesalerOrderQuoteItems_QuoteItems_ProductDescription [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_ShrinkQuantity [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_Subdepartment [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_UniqueName [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_UnitEAN [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_UnitSize [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_Variant [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_WholesalerName [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_WholesalerUniqueName [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_RequestedUnitVAT decimal(18,2) NULL,
WholesalerOrderQuoteItems_QuoteItems_QuotedUnitVAT decimal(18,2) NULL,
WholesalerFinalOrderItems_FinalOrderItems_Image [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_FinalOrderUnitVAT decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FulfilmentUnitVAT decimal(18,2) NULL,
WholesalerFinalOrderItems_FinalOrderItems_ProductDescription [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_ProductDescription [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_UniqueName [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_UniqueName [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_Variant [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_Variant [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_UnitSize [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_UnitSize [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_UnitEAN [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_UnitEAN [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_NonVATItem bit NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_NonVATItem bit NULL,
WholesalerOrderQuoteItems_QuoteItems_NonVATItem bit NULL,
WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitPrice [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_RequestedUnitPrice decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitPrice [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderUnitQuantity [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_RequestedUnitQuantity [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_QuotedUnitQuantity [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_QuotedTotalAmount [nvarchar](max) NULL,
WholesalerOrderQuoteItems_QuoteItems_RequestedTotalAmount decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FinalOrderTotalAmount [nvarchar](max) NULL,
WholesalerFinalOrderItems_FinalOrderItems_FinalOrderExtraGP decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FulfilmentExtraGP decimal(18,2) NULL,
WholesalerOrderQuoteItems_QuoteItems_ProvisionalExtraGP decimal(18,2) NULL,
WholesalerFinalOrderItems_FinalOrderItems_PriceExpires [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_PriceExpires [nvarchar](max) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_OrderFulfilmentItemConfirmed bit NULL,
WholesalerFinalOrderItems_FinalOrderItems_FinalOrderItemAccepted bit NULL,
WholesalerOrderQuoteItems_QuoteItems_QuotedItemAvailable bit NULL,
WholesalerOrderQuoteItems_QuoteItems_QuotedUnitPrice decimal(18,2) NULL,
WholesalerFinalOrderItems_FinalOrderItems_FinalOrderUnitPrice decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FulfilmentUnitPrice decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FulfilmentUnitQuantity int NULL,
WholesalerFinalOrderItems_FinalOrderItems_FinalOrderUnitQuantity int NULL,
WholesalerOrderQuoteItems_QuoteItems_QuotedUnitQuantity int NULL,
WholesalerFinalOrderItems_FinalOrderItems_FinalOrderTotalAmount decimal(18,2) NULL,
WholesalerOrderQuoteItems_QuoteItems_QuotedTotalAmount decimal(18,2) NULL,
WholesalerOrderFulfilmentItems_OrderFulfilmentItems_FulfilmentTotalAmount decimal(18,2) NULL,
WholesalerOrderQuoteItems_QuoteItems_Image [nvarchar](max) NULL;
END;

/** WSName to second place **/
update pal_SurfaceField
set sequence = 2
where recId = 1730;

/* WS VAT Amount in new line */
update pal_SurfaceField
set isOnNewLine = 1
where recId = 3153

/*btn PlaceFinalOrder lower */
update pal_SurfaceField
set isLabelHidden = 1
where recId = 1741