﻿<?xml version="1.0" encoding="utf-16"?>
<JiwaDocument xmlns:jiwa="http://www.jiwa.com.au/xml/schemas" Type="JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin">
  <RecID>b0ce5238-5c7b-e011-9a17-001a4d4abfac</RecID>
  <Name>Modified Sales Order Customer Panel</Name>
  <Description>Copy of the Sales Order Customer Panel to collapse (hide) panel if the Account No of the debtor is "1001"</Description>
  <IsEnabled>true</IsEnabled>
  <IsIsolatedToOwnAppDomain>false</IsIsolatedToOwnAppDomain>
  <ExecutionOrder>0</ExecutionOrder>
  <Author>Jiwa Financials</Author>
  <Version>7.0.167.0</Version>
  <Code>Imports JiwaFinancials.Jiwa
Imports VB6 = Microsoft.VisualBasic.Compatibility.VB6
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Data.SqlClient

Public Class FormPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaFormPlugin

    Public Overrides Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub SetupBeforeHandlers(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.SetupBeforeHandlers
    End Sub

    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
		If TypeOf JiwaForm Is JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm Then
			Dim panelForm As New CustomerPanel 
			panelForm.Setup(JiwaForm, Plugin)
		End If
    End Sub
End Class


Public Class CustomerPanel
    Private panelForm As CustomerPanel
    Private salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm
    Private _moneyCellType As New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType
    Private salesOrderFormIsClosing As Boolean

    Private startupSplitter1Panel1Height As Integer
    Private viewCustomersPreviousSales As Boolean
    Private viewProductSalesHistory As Boolean
    Private viewProductUpsells As Boolean
    Private viewStockSummary As Boolean
    Private Splitter As Infragistics.Win.Misc.UltraSplitter
    Private customerPanel As Infragistics.Win.Misc.UltraPanel
	Private splitterWidth As Integer 

    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin)
        If TypeOf JiwaForm Is JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm Then
            panelForm = Me

            salesOrderForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)
            _moneyCellType.DecimalPlaces = salesOrderForm.SalesOrder.SystemSettings.SalesOrdersMoneyDecimalPlaces

            Dim newPanel As New Infragistics.Win.Misc.UltraPanel
            newPanel.Name = "newPanel"
            salesOrderForm.SalesOrderEntryForm_Fill_Panel.Controls.Add(newPanel)
            newPanel.Dock = DockStyle.Fill

            newPanel.ClientArea.Controls.Add(salesOrderForm.UltraPanel1)

            Splitter = New Infragistics.Win.Misc.UltraSplitter
            Splitter.Name = "splitter"            
            newPanel.ClientArea.Controls.Add(Splitter)
            Splitter.Dock = DockStyle.Right

            customerPanel = New Infragistics.Win.Misc.UltraPanel
            customerPanel.Name = "customerPanel"
            newPanel.ClientArea.Controls.Add(customerPanel)
            customerPanel.Dock = DockStyle.Right

            Me.TopLevel = False
            customerPanel.ClientArea.Controls.Add(Me)
            Me.Dock = DockStyle.Fill            
            Me.MinimizeBox = False
            Me.MaximizeBox = False
            Me.ControlBox = False
            Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None

            SetupControls()

            AddHandler salesOrderForm.SalesOrder.PropertyChanged, AddressOf SalesOrder_PropertyChanged
            AddHandler salesOrderForm.SalesOrder.ReadEnd, AddressOf SalesOrder_ReadCompleted
            AddHandler salesOrderForm.SalesOrder.Created, AddressOf SalesOrder_Created            
            AddHandler salesOrderForm.grdLines.ActiveSheet.PropertyChanged, AddressOf grdLines_ActiveSheet_PropertyChanged
            AddHandler salesOrderForm.FormClosing, AddressOf salesOrderForm_FormClosing

            'AddHandler panelForm.Shown, AddressOf panelForm_Shown
            AddHandler panelForm.grdCustomerPreviousSales.ButtonClicked, AddressOf grdCustomerPreviousSales_ButtonClicked
            AddHandler panelForm.NumericEditor1.ValueChanged, AddressOf NumericEditor1_ValueChanged
            AddHandler panelForm.grdProductUpSells.ButtonClicked, AddressOf grdProductUpSells_ButtonClicked
            AddHandler panelForm.UltraToolbarsManager1.ToolClick, AddressOf panelForm_ToolClick

            RestorePersistedValues()

            Me.Show()

        End If
    End Sub

    Public Sub SalesOrder_PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs)
        If e.PropertyName = "DebtorID" Then
            ReadCustomerSalesHistory()
        End If
    End Sub

    Public Sub SalesOrder_ReadCompleted(sender As Object, e As System.EventArgs)
		ReadCustomerSalesHistory()
        DisplayProductDetailsForRow(0)
			
		Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = sender
		If salesOrder.Debtor.AccountNo = "1001" Then
			Splitter.Collapsed = True
		Else
			Splitter.Collapsed = False			
		End If			        
    End Sub

    Public Sub SalesOrder_Created(sender As Object, e As System.EventArgs, ByVal NewSalesOrderType As JiwaSales.SalesOrder.SalesOrder.NewSalesOrderTypes, ByRef SourceQuoteObject As JiwaSales.SalesQuote.SalesQuote)
        ReadCustomerSalesHistory()
        DisplayProductDetailsForRow(0)
		
		Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = sender
		If salesOrder.Debtor.AccountNo = "1001" Then
			Splitter.Collapsed = True
		Else
			Splitter.Collapsed = False			
		End If
    End Sub

    'Public Sub panelForm_Shown(sender As Object, e As System.EventArgs)
    Public Sub RestorePersistedValues()
        ' Restore persistable values
        Dim Contents As String = ""

        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Visible", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                Splitter.Collapsed = Not CBool(Contents)
            Else
                If UCase(Contents.Trim) = "TRUE" Then
                    Splitter.Collapsed = False
                End If
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "NumberDays", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                panelForm.NumericEditor1.Value = CInt(Contents)
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "PanelWidth", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                customerPanel.Width = CInt(Contents)
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewCustomersPreviousSales", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                viewCustomersPreviousSales = CBool(Contents)
            Else
                If UCase(Contents.Trim) = "TRUE" Then
                    viewCustomersPreviousSales = True
                End If
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewCustomersPreviousSales", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                viewCustomersPreviousSales = CBool(Contents)
            Else
                If UCase(Contents.Trim) = "TRUE" Then
                    viewCustomersPreviousSales = True
                End If
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewProductSalesHistory", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                viewProductSalesHistory = CBool(Contents)
            Else
                If UCase(Contents.Trim) = "TRUE" Then
                    viewProductSalesHistory = True
                End If
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewProductUpsells", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                viewProductUpsells = CBool(Contents)
            Else
                If UCase(Contents.Trim) = "TRUE" Then
                    viewProductUpsells = True
                End If
            End If
        End If

        Contents = ""
        JiwaApplication.Manager.Instance.JLib.GetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewStockSummary", Contents)
        If Contents.Trim.Length &gt; 0 Then
            If IsNumeric(Contents) Then
                viewStockSummary = CBool(Contents)
            Else
                If UCase(Contents.Trim) = "TRUE" Then
                    viewStockSummary = True
                End If
            End If
        End If

        DirectCast(panelForm.UltraToolbarsManager1.Tools("Customers Previous Sales"), Infragistics.Win.UltraWinToolbars.StateButtonTool).Checked = viewCustomersPreviousSales
        DirectCast(panelForm.UltraToolbarsManager1.Tools("Product Sales History"), Infragistics.Win.UltraWinToolbars.StateButtonTool).Checked = viewProductSalesHistory
        DirectCast(panelForm.UltraToolbarsManager1.Tools("Product Upsells"), Infragistics.Win.UltraWinToolbars.StateButtonTool).Checked = viewProductUpsells
        DirectCast(panelForm.UltraToolbarsManager1.Tools("Stock Summary"), Infragistics.Win.UltraWinToolbars.StateButtonTool).Checked = viewStockSummary
        SetSplitterPanelCollapsedStates()
    End Sub

    Public Sub grdCustomerPreviousSales_ButtonClicked(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EditorNotifyEventArgs)
        Dim column As FarPoint.Win.Spread.Column = panelForm.grdCustomerPreviousSales.ActiveSheet.Columns(e.Column)

        If UCase(column.Tag) = UCase("Add") Then
            Dim InventoryID As String = panelForm.grdCustomerPreviousSales.GridText("InventoryID", e.Row)
            Dim NewKey As String = ""

            salesOrderForm.SalesOrder.SalesOrderLines.AddInventoryItem(InventoryID, JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLineInventoryID, NewKey)
        End If
    End Sub

    Public Sub grdProductUpSells_ButtonClicked(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EditorNotifyEventArgs)
        Dim column As FarPoint.Win.Spread.Column = panelForm.grdProductUpSells.ActiveSheet.Columns(e.Column)

        If UCase(column.Tag) = UCase("Add") Then
            Dim InventoryID As String = panelForm.grdProductUpSells.GridText("InventoryID", e.Row)
            Dim NewKey As String = ""

            salesOrderForm.SalesOrder.SalesOrderLines.AddInventoryItem(InventoryID, JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLineInventoryID, NewKey)
        End If
    End Sub

    Private Sub grdLines_ActiveSheet_PropertyChanged(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.SheetViewPropertyChangeEventArgs)
        If e.PropertyName = "ActiveCell" Then
            DisplayProductDetailsForRow(salesOrderForm.grdLines.ActiveSheet.ActiveRowIndex())
        End If
    End Sub

    Public Sub grdLines_EnterCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EnterCellEventArgs)
        DisplayProductDetailsForRow(e.Row)
    End Sub

    Public Sub panelForm_ToolClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
        SetSplitterPanelCollapsedStates()
    End Sub

    Public Sub SetSplitterPanelCollapsedStates()
        Dim tool As Infragistics.Win.UltraWinToolbars.StateButtonTool

        tool = panelForm.UltraToolbarsManager1.Tools("Customers Previous Sales")
        panelForm.SplitContainer1.Panel1Collapsed = Not tool.Checked

        tool = panelForm.UltraToolbarsManager1.Tools("Product Sales History")
        panelForm.SplitContainer2.Panel1Collapsed = Not tool.Checked

        tool = panelForm.UltraToolbarsManager1.Tools("Product Upsells")
        panelForm.SplitContainer3.Panel1Collapsed = Not tool.Checked

        tool = panelForm.UltraToolbarsManager1.Tools("Stock Summary")
        panelForm.SplitContainer4.Panel1Collapsed = Not tool.Checked
    End Sub

    Public Sub DisplayProductDetailsForRow(ByVal Row As Integer)
        Static LastDebtorID As String
        Static LastInventoryID As String

        If Row &gt; salesOrderForm.grdLines.ActiveSheet.RowCount - 1 Then
            Exit Sub
        End If

        Dim Key As String = salesOrderForm.grdLines.GridText("Key", Row)
        Dim InventoryID As String = ""

        If Key.Trim.Length &gt; 0 AndAlso salesOrderForm.SalesOrder.SalesOrderLines.Contains(Key) Then
            InventoryID = salesOrderForm.SalesOrder.SalesOrderLines(Key).InventoryID
            panelForm.UltraGroupBox2.Text = "Product Sales History For : " &amp; salesOrderForm.SalesOrder.SalesOrderLines(Key).PartNo
            panelForm.UltraGroupBox3.Text = "Product Upsells For : " &amp; salesOrderForm.SalesOrder.SalesOrderLines(Key).PartNo
            panelForm.UltraGroupBox4.Text = "Stock Summary For : " &amp; salesOrderForm.SalesOrder.SalesOrderLines(Key).PartNo
        End If

        If LastInventoryID &lt;&gt; InventoryID OrElse LastDebtorID &lt;&gt; salesOrderForm.SalesOrder.Debtor.DebtorID Then
            LastInventoryID = InventoryID
            LastDebtorID = salesOrderForm.SalesOrder.Debtor.DebtorID
            ReadProductSalesHistory(InventoryID)
            ReadProductUpSells(InventoryID)
            ReadStockSummary(InventoryID)
        End If
    End Sub

    Public Sub NumericEditor1_ValueChanged(sender As Object, e As System.EventArgs)
        ReadCustomerSalesHistory()
        If Not salesOrderForm.grdLines.ActiveSheet.ActiveRow Is Nothing Then
            DisplayProductDetailsForRow(salesOrderForm.grdLines.ActiveSheet.ActiveRow.Index)
        Else
            panelForm.UltraGroupBox2.Text = "Product Sales History For : "
            panelForm.UltraGroupBox3.Text = "Product Upsells For : "
            panelForm.UltraGroupBox4.Text = "Stock Summary For : "

            panelForm.grdProductPreviousSales.ActiveSheet.RowCount = 0
            panelForm.grdProductUpSells.ActiveSheet.RowCount = 0
            panelForm.grdStockSummary.ActiveSheet.RowCount = 0
        End If
    End Sub

    Public Sub salesOrderForm_FormClosing(sender As Object, e As System.ComponentModel.CancelEventArgs)
        Dim oldSalesOrderFormIsClosing As Boolean = salesOrderFormIsClosing

        Try
            salesOrderFormIsClosing = True
            ' Save Numeric Days and Visible state	
            Dim tool As Infragistics.Win.UltraWinToolbars.StateButtonTool

            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Visible", Not Splitter.Collapsed)
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "NumberDays", panelForm.NumericEditor1.Value)
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "PanelWidth", customerPanel.Width)

            tool = panelForm.UltraToolbarsManager1.Tools("Customers Previous Sales")
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewCustomersPreviousSales", tool.Checked)
            tool = panelForm.UltraToolbarsManager1.Tools("Product Sales History")
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewProductSalesHistory", tool.Checked)
            tool = panelForm.UltraToolbarsManager1.Tools("Product Upsells")
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewProductUpsells", tool.Checked)
            tool = panelForm.UltraToolbarsManager1.Tools("Stock Summary")
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "ViewStockSummary", tool.Checked)

            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter1Panel1Height", panelForm.SplitContainer1.Panel1.Height)
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter1Panel2Height", panelForm.SplitContainer1.Panel2.Height)

            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter2Panel1Height", panelForm.SplitContainer2.Panel1.Height)
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter2Panel2Height", panelForm.SplitContainer2.Panel2.Height)

            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter3Panel1Height", panelForm.SplitContainer3.Panel1.Height)
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter3Panel2Height", panelForm.SplitContainer3.Panel2.Height)

            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter4Panel1Height", panelForm.SplitContainer4.Panel1.Height)
            JiwaApplication.Manager.Instance.JLib.SetProfileKey(JiwaApplication.Manager.Instance.Database.JiwaLoginUserID, "Sales Order Customer Panel", "Splitter4Panel2Height", panelForm.SplitContainer4.Panel2.Height)
            panelForm.Close()
        Finally
            salesOrderFormIsClosing = oldSalesOrderFormIsClosing
        End Try
    End Sub

    Public Sub SetupControls()
        SetupCustomerPreviousSalesGrid()
        SetupProductPreviousSalesGrid()
        SetupProductUpSellsGrid()
        SetupStockSummaryGrid()
    End Sub

    Public Sub SetupCustomerPreviousSalesGrid()
        panelForm.grdCustomerPreviousSales.AddColumn("InvoiceID", New FarPoint.Win.Spread.CellType.TextCellType, "InvoiceID", 0, , False, True, True)
        panelForm.grdCustomerPreviousSales.AddColumn("InvoiceNo", New FarPoint.Win.Spread.CellType.TextCellType, "Invoice No.", 20, , , True, True, , True)
        panelForm.grdCustomerPreviousSales.AddColumn("Date", New FarPoint.Win.Spread.CellType.DateTimeCellType, "Date", 20, , , True, True)
        panelForm.grdCustomerPreviousSales.AddColumn("InventoryID", New FarPoint.Win.Spread.CellType.TextCellType, "InventoryID", 0, , False, True, True)
        panelForm.grdCustomerPreviousSales.AddColumn("PartNo", New FarPoint.Win.Spread.CellType.TextCellType, "Part No.", 20, , , True, True, , True)
        panelForm.grdCustomerPreviousSales.AddColumn("Description", New FarPoint.Win.Spread.CellType.TextCellType, "Description", 30, , , True, True)
        panelForm.grdCustomerPreviousSales.AddColumn("Quantity", New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType, "Quantity", 20, , , True, True)
        panelForm.grdCustomerPreviousSales.AddColumn("Price", _moneyCellType, "Price", 20, , , True, True)
        panelForm.grdCustomerPreviousSales.AddColumn("Add", New JiwaApplication.JiwaManageGrid.JiwaLookupButtonCellType, "")
        panelForm.grdCustomerPreviousSales.SetupComplete()
    End Sub

    Public Sub SetupProductPreviousSalesGrid()
        panelForm.grdProductPreviousSales.AddColumn("InvoiceID", New FarPoint.Win.Spread.CellType.TextCellType, "InvoiceID", 0, , False, True, True)
        panelForm.grdProductPreviousSales.AddColumn("InvoiceNo", New FarPoint.Win.Spread.CellType.TextCellType, "Invoice No.", 20, , , True, True, , True)
        panelForm.grdProductPreviousSales.AddColumn("Date", New FarPoint.Win.Spread.CellType.DateTimeCellType, "Date", 20, , , True, True)
        panelForm.grdProductPreviousSales.AddColumn("Quantity", New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType, "Quantity", 20, , , True, True)
        panelForm.grdProductPreviousSales.AddColumn("PriceInc", _moneyCellType, "Price Inc.", 20, , , True, True)
        panelForm.grdProductPreviousSales.AddColumn("Discount", _moneyCellType, "Discount", 20, , , True, True)
        panelForm.grdProductPreviousSales.SetupComplete()
    End Sub

    Public Sub SetupProductUpSellsGrid()
        panelForm.grdProductUpSells.AddColumn("InventoryID", New FarPoint.Win.Spread.CellType.TextCellType, "InventoryID", 0, , False, True, True)
        panelForm.grdProductUpSells.AddColumn("PartNo", New FarPoint.Win.Spread.CellType.TextCellType, "Part No.", 20, , , True, True, , True)
        panelForm.grdProductUpSells.AddColumn("Description", New FarPoint.Win.Spread.CellType.TextCellType, "Description", 30, , , True, True)
        panelForm.grdProductUpSells.AddColumn("Details", New FarPoint.Win.Spread.CellType.TextCellType, "Details", 60, , , True, True)
        panelForm.grdProductUpSells.AddColumn("Quantity", New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType, "Quantity", 20, , , True, True)
        panelForm.grdProductUpSells.AddColumn("Add", New JiwaApplication.JiwaManageGrid.JiwaLookupButtonCellType, "")
        panelForm.grdProductUpSells.SetupComplete()
    End Sub

    Public Sub SetupStockSummaryGrid()
        panelForm.grdStockSummary.AddColumn("Warehouse", New FarPoint.Win.Spread.CellType.TextCellType, "Warehouse", 65, , , True, True, , True)
        panelForm.grdStockSummary.AddColumn("SOH", New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType, "SOH", 25, , , True, True)
        panelForm.grdStockSummary.AddColumn("BackOrders", New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType, "BackOrders", 25, , , True, True)
        panelForm.grdStockSummary.AddColumn("Free", New JiwaApplication.JiwaManageGrid.JiwaCurrencyCellType, "Free", 25, , , True, True)
        panelForm.grdStockSummary.SetupComplete()
    End Sub

    Public Sub ReadCustomerSalesHistory()
        Dim Sql As String
        Dim SQLReader As SqlDataReader = Nothing
        Dim SQLParam As SqlParameter = Nothing

        Try
            panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount = 0

            If salesOrderForm.SalesOrder.Debtor.DebtorID.Trim.Length &gt; 0 Then
                With JiwaApplication.Manager.Instance.Database

                    Sql = "SELECT SO_Main.InvoiceID, SO_Main.InvoiceNo, SO_Main.InvoiceInitDate, SO_Lines.InventoryID, SO_Lines.PartNo, SO_Lines.Description, SO_Lines.QuantityOrdered, SO_Lines.ItemPrice, DecimalPlaces " &amp;
                         "FROM SO_Main JOIN SO_History ON SO_History.InvoiceID = SO_Main.InvoiceID " &amp;
                         "JOIN SO_Lines ON SO_Lines.InvoiceHistoryID = SO_History.InvoiceHistoryID " &amp;
                         "WHERE SO_Main.DebtorID = @DebtorID " &amp;
                         "AND SO_History.HistoryNo = 1 " &amp;
                         "AND SO_Main.CreditNote = 0 " &amp;
                         "AND SO_Main.InvoiceInitDate &gt;= @InvoiceDate " &amp;
                         "ORDER BY SO_Main.InvoiceInitDate DESC"

                    Using SQLCmd As SqlCommand = New SqlCommand(Sql, .SQLConnection, .SQLTransaction)

                        SQLParam = New SqlParameter("@DebtorID", System.Data.SqlDbType.Char)
                        SQLParam.Value = salesOrderForm.SalesOrder.Debtor.DebtorID
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLParam = New SqlParameter("@InvoiceDate", System.Data.SqlDbType.DateTime)
                        SQLParam.Value = DateAdd("d", panelForm.NumericEditor1.Value * -1, JiwaApplication.Manager.Instance.Database.SysDateTime)
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLReader = .ExecuteReader(SQLCmd)

                        Do While SQLReader.Read = True
                            panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount = panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount + 1

                            panelForm.grdCustomerPreviousSales.GridText("InvoiceID", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InvoiceID")
                            panelForm.grdCustomerPreviousSales.GridText("InvoiceNo", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InvoiceNo")
                            panelForm.grdCustomerPreviousSales.GridText("Date", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InvoiceInitDate")
                            panelForm.grdCustomerPreviousSales.GridText("InventoryID", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InventoryID")
                            panelForm.grdCustomerPreviousSales.GridText("PartNo", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "PartNo")
                            panelForm.grdCustomerPreviousSales.GridText("Description", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "Description")
                            panelForm.grdCustomerPreviousSales.GridText("Quantity", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "QuantityOrdered")
                            panelForm.grdCustomerPreviousSales.GridDecimalPlaces("Quantity", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1, .Sanitise(SQLReader, "DecimalPlaces"), panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1)
                            panelForm.grdCustomerPreviousSales.GridText("Price", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "ItemPrice")

                            panelForm.grdCustomerPreviousSales.LockColumn(True, "Add", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1)

                            If salesOrderForm.SalesOrder.SalesOrderStatus &lt;= JiwaSales.SalesOrder.SalesOrder.SalesOrderStatuses.e_SalesOrderEntered And salesOrderForm.SalesOrder.SelectedHistoryNo = 1 And salesOrderForm.SalesOrder.CurrentHistoryNo = 1 Then
                                panelForm.grdCustomerPreviousSales.LockColumn(False, "Add", panelForm.grdCustomerPreviousSales.ActiveSheet.RowCount - 1)
                            End If
                        Loop

                        SQLReader.Close()
                    End Using
                End With
            End If
        Finally
            If Not SQLReader Is Nothing Then
                SQLReader.Close()
            End If
        End Try
    End Sub

    Public Sub ReadProductSalesHistory(ByVal InventoryID As String)
        Dim Sql As String
        Dim SQLReader As SqlDataReader = Nothing
        Dim SQLParam As SqlParameter = Nothing

        Try
            panelForm.grdProductPreviousSales.ActiveSheet.RowCount = 0

            If InventoryID.Trim.Length &gt; 0 Then
                With JiwaApplication.Manager.Instance.Database

                    Sql = "SELECT SO_Main.InvoiceNo, SO_Main.InvoiceInitDate, SO_Lines.QuantityOrdered, SO_Lines.ItemPriceIncGST, SO_Lines.Discount, SO_Main.InvoiceID, SO_Lines.DecimalPlaces " &amp;
                         "FROM SO_Main JOIN SO_History ON SO_History.InvoiceID = SO_Main.InvoiceID " &amp;
                         "JOIN SO_Lines ON SO_Lines.InvoiceHistoryID = SO_History.InvoiceHistoryID " &amp;
                         "WHERE SO_Main.DebtorID = @DebtorID " &amp;
             "AND SO_Lines.InventoryID = @InventoryID " &amp;
             "AND SO_Main.InvoiceID &lt;&gt; @InvoiceID " &amp;
                         "AND SO_History.HistoryNo = 1 " &amp;
                         "AND SO_Main.CreditNote = 0 " &amp;
                         "AND SO_Main.InvoiceInitDate &gt;= @InvoiceDate " &amp;
                         "ORDER BY SO_Main.InvoiceInitDate DESC"

                    Using SQLCmd As SqlCommand = New SqlCommand(Sql, .SQLConnection, .SQLTransaction)

                        SQLParam = New SqlParameter("@DebtorID", System.Data.SqlDbType.Char)
                        SQLParam.Value = salesOrderForm.SalesOrder.Debtor.DebtorID
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLParam = New SqlParameter("@InventoryID", System.Data.SqlDbType.Char)
                        SQLParam.Value = InventoryID
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLParam = New SqlParameter("@InvoiceID", System.Data.SqlDbType.Char)
                        SQLParam.Value = salesOrderForm.SalesOrder.InvoiceID
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLParam = New SqlParameter("@InvoiceDate", System.Data.SqlDbType.DateTime)
                        SQLParam.Value = DateAdd("d", panelForm.NumericEditor1.Value * -1, JiwaApplication.Manager.Instance.Database.SysDateTime)
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLReader = .ExecuteReader(SQLCmd)

                        Do While SQLReader.Read = True
                            panelForm.grdProductPreviousSales.ActiveSheet.RowCount = panelForm.grdProductPreviousSales.ActiveSheet.RowCount + 1

                            panelForm.grdProductPreviousSales.GridText("InvoiceID", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InvoiceID")
                            panelForm.grdProductPreviousSales.GridText("InvoiceNo", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InvoiceNo")
                            panelForm.grdProductPreviousSales.GridText("Date", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "InvoiceInitDate")
                            panelForm.grdProductPreviousSales.GridText("Quantity", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "QuantityOrdered")
                            panelForm.grdProductPreviousSales.GridDecimalPlaces("Quantity", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1, .Sanitise(SQLReader, "DecimalPlaces"), panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1)
                            panelForm.grdProductPreviousSales.GridText("PriceInc", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "ItemPriceIncGST")
                            panelForm.grdProductPreviousSales.GridText("Discount", panelForm.grdProductPreviousSales.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "Discount")
                        Loop

                        SQLReader.Close()
                    End Using
                End With
            End If
        Finally
            If Not SQLReader Is Nothing Then
                SQLReader.Close()
            End If
        End Try
    End Sub

    Public Sub ReadProductUpSells(ByVal InventoryID As String)
        Dim Sql As String
        Dim SQLReader As SqlDataReader = Nothing
        Dim SQLParam As SqlParameter = Nothing

        Try
            panelForm.grdProductUpSells.ActiveSheet.RowCount = 0

            If InventoryID.Trim.Length &gt; 0 Then
                With JiwaApplication.Manager.Instance.Database

                    Sql = "SELECT IN_Main.PartNo, IN_Main.Description [IN_Main_Description], IN_Upsell.Description [Upsell_Description], IN_Upsell.UpSellInventoryID, IN_Upsell.Quantity, IN_Main.DecimalPlaces " &amp;
                         "FROM IN_Main JOIN IN_UpSell ON IN_Main.InventoryID = IN_UpSell.UpSellInventoryID " &amp;
                         "WHERE IN_UpSell.InventoryID = @InventoryID " &amp;
                         "ORDER BY IN_Main.PartNo"

                    Using SQLCmd As SqlCommand = New SqlCommand(Sql, .SQLConnection, .SQLTransaction)

                        SQLParam = New SqlParameter("@InventoryID", System.Data.SqlDbType.Char)
                        SQLParam.Value = InventoryID
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLReader = .ExecuteReader(SQLCmd)

                        Do While SQLReader.Read = True
                            panelForm.grdProductUpSells.ActiveSheet.RowCount = panelForm.grdProductUpSells.ActiveSheet.RowCount + 1

                            panelForm.grdProductUpSells.GridText("InventoryID", panelForm.grdProductUpSells.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "UpSellInventoryID")
                            panelForm.grdProductUpSells.GridText("PartNo", panelForm.grdProductUpSells.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "PartNo")
                            panelForm.grdProductUpSells.GridText("Description", panelForm.grdProductUpSells.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "IN_Main_Description")
                            panelForm.grdProductUpSells.GridText("Details", panelForm.grdProductUpSells.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "Upsell_Description")

                            panelForm.grdProductUpSells.GridText("Quantity", panelForm.grdProductUpSells.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "Quantity")
                            panelForm.grdProductUpSells.GridDecimalPlaces("Quantity", panelForm.grdProductUpSells.ActiveSheet.RowCount - 1, .Sanitise(SQLReader, "DecimalPlaces"), panelForm.grdProductUpSells.ActiveSheet.RowCount - 1)
                        Loop

                        SQLReader.Close()
                    End Using
                End With
            End If
        Finally
            If Not SQLReader Is Nothing Then
                SQLReader.Close()
            End If
        End Try
    End Sub

    Public Sub ReadStockSummary(ByVal InventoryID As String)
        Dim Sql As String
        Dim SQLReader As SqlDataReader = Nothing
        Dim SQLParam As SqlParameter = Nothing
        Dim totalSOH As Decimal
        Dim totalBackOrders As Decimal
        Dim totalFree As Decimal

        Try
            panelForm.grdStockSummary.ActiveSheet.RowCount = 0

            If InventoryID.Trim.Length &gt; 0 Then
                With JiwaApplication.Manager.Instance.Database

                    Sql = "usp_jiwa_warehouse_soh_summary"

                    Using SQLCmd As SqlCommand = New SqlCommand(Sql, .SQLConnection, .SQLTransaction)
                        SQLCmd.CommandType = System.Data.CommandType.StoredProcedure

                        SQLParam = New SqlParameter("@InventoryID", System.Data.SqlDbType.Char)
                        SQLParam.Value = InventoryID
                        SQLCmd.Parameters.Add(SQLParam)

                        SQLReader = .ExecuteReader(SQLCmd)
						
						If SQLReader.HasRows Then
                    		SQLReader.NextResult()
						End If

                        Do While SQLReader.Read = True
                            panelForm.grdStockSummary.ActiveSheet.RowCount = panelForm.grdStockSummary.ActiveSheet.RowCount + 1

                            panelForm.grdStockSummary.GridText("Warehouse", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "WarehouseDescription")
                            panelForm.grdStockSummary.GridText("SOH", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "TotalSOH")
                            panelForm.grdStockSummary.GridText("BackOrders", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "TotalBackOrder")
                            panelForm.grdStockSummary.GridText("Free", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = .Sanitise(SQLReader, "TotalSOH") - .Sanitise(SQLReader, "TotalBackOrder")

                            totalSOH = totalSOH + .Sanitise(SQLReader, "TotalSOH")
                            totalBackOrders = totalBackOrders + .Sanitise(SQLReader, "TotalBackOrder")
                            totalFree = totalFree + .Sanitise(SQLReader, "TotalSOH") - .Sanitise(SQLReader, "TotalBackOrder")
                        Loop

                        SQLReader.Close()
                    End Using

                    panelForm.grdStockSummary.ActiveSheet.RowCount = panelForm.grdStockSummary.ActiveSheet.RowCount + 1
                    panelForm.grdStockSummary.GridText("Warehouse", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = "Total"
                    panelForm.grdStockSummary.GridText("SOH", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = totalSOH
                    panelForm.grdStockSummary.GridText("BackOrders", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = totalBackOrders
                    panelForm.grdStockSummary.GridText("Free", panelForm.grdStockSummary.ActiveSheet.RowCount - 1) = totalFree

                    panelForm.grdStockSummary.ActiveSheet.Cells(panelForm.grdStockSummary.ActiveSheet.RowCount - 1, 0, panelForm.grdStockSummary.ActiveSheet.RowCount - 1, 3).Font = New System.Drawing.Font(panelForm.grdStockSummary.Font.FontFamily.Name, panelForm.grdStockSummary.Font.Size, System.Drawing.FontStyle.Bold)
                End With
            End If
        Finally
            If Not SQLReader Is Nothing Then
                SQLReader.Close()
            End If
        End Try
    End Sub
End Class
	
Partial Class CustomerPanel
    Inherits System.Windows.Forms.Form

    Public Sub New()
        InitializeComponent()
    End Sub

    'Form overrides dispose to clean up the component list.
    &lt;System.Diagnostics.DebuggerNonUserCode()&gt; _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    &lt;System.Diagnostics.DebuggerStepThrough()&gt; _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim UltraToolbar1 As Infragistics.Win.UltraWinToolbars.UltraToolbar = New Infragistics.Win.UltraWinToolbars.UltraToolbar("ViewMenu")
        Dim PopupMenuTool1 As Infragistics.Win.UltraWinToolbars.PopupMenuTool = New Infragistics.Win.UltraWinToolbars.PopupMenuTool("View")
        Dim PopupMenuTool2 As Infragistics.Win.UltraWinToolbars.PopupMenuTool = New Infragistics.Win.UltraWinToolbars.PopupMenuTool("View")
        Dim StateButtonTool1 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Customers Previous Sales", "")
        Dim StateButtonTool2 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Product Sales History", "")
        Dim StateButtonTool3 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Product Upsells", "")
        Dim StateButtonTool4 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Stock Summary", "")
        Dim StateButtonTool5 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Customers Previous Sales", "")
        Dim StateButtonTool6 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Product Sales History", "")
        Dim StateButtonTool7 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Product Upsells", "")
        Dim StateButtonTool8 As Infragistics.Win.UltraWinToolbars.StateButtonTool = New Infragistics.Win.UltraWinToolbars.StateButtonTool("Stock Summary", "")
        Dim grdStockSummary_InputMapWhenAncestorOfFocusedNormal As FarPoint.Win.Spread.InputMap
        Dim grdProductUpSells_InputMapWhenAncestorOfFocusedNormal As FarPoint.Win.Spread.InputMap
        Dim grdProductPreviousSales_InputMapWhenAncestorOfFocusedNormal As FarPoint.Win.Spread.InputMap
        Dim grdCustomerPreviousSales_InputMapWhenAncestorOfFocusedNormal As FarPoint.Win.Spread.InputMap
        Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
        Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
        Me.SplitContainer3 = New System.Windows.Forms.SplitContainer()
        Me.SplitContainer4 = New System.Windows.Forms.SplitContainer()
        Me.UltraLabel1 = New Infragistics.Win.Misc.UltraLabel()
        Me.NumericEditor1 = New JiwaFinancials.Jiwa.JiwaApplication.Controls.NumericEditor()
        Me.UltraToolbarsManager1 = New Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(Me.components)
        Me._CustomerPanel_Toolbars_Dock_Area_Left = New Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea()
        Me._CustomerPanel_Toolbars_Dock_Area_Right = New Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea()
        Me._CustomerPanel_Toolbars_Dock_Area_Top = New Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea()
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom = New Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea()
        Me.UltraPanel1 = New Infragistics.Win.Misc.UltraPanel()
        Me.grdStockSummary = New JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid()
        Me.UltraGroupBox4 = New Infragistics.Win.Misc.UltraGroupBox()
        Me.grdProductUpSells = New JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid()
        Me.UltraGroupBox3 = New Infragistics.Win.Misc.UltraGroupBox()
        Me.grdProductPreviousSales = New JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid()
        Me.UltraGroupBox2 = New Infragistics.Win.Misc.UltraGroupBox()
        Me.grdCustomerPreviousSales = New JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid()
        Me.UltraGroupBox1 = New Infragistics.Win.Misc.UltraGroupBox()
        grdStockSummary_InputMapWhenAncestorOfFocusedNormal = New FarPoint.Win.Spread.InputMap()
        grdProductUpSells_InputMapWhenAncestorOfFocusedNormal = New FarPoint.Win.Spread.InputMap()
        grdProductPreviousSales_InputMapWhenAncestorOfFocusedNormal = New FarPoint.Win.Spread.InputMap()
        grdCustomerPreviousSales_InputMapWhenAncestorOfFocusedNormal = New FarPoint.Win.Spread.InputMap()
        CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SplitContainer1.Panel1.SuspendLayout()
        Me.SplitContainer1.Panel2.SuspendLayout()
        Me.SplitContainer1.SuspendLayout()
        CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SplitContainer2.Panel1.SuspendLayout()
        Me.SplitContainer2.Panel2.SuspendLayout()
        Me.SplitContainer2.SuspendLayout()
        CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SplitContainer3.Panel1.SuspendLayout()
        Me.SplitContainer3.Panel2.SuspendLayout()
        Me.SplitContainer3.SuspendLayout()
        CType(Me.SplitContainer4, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SplitContainer4.Panel1.SuspendLayout()
        Me.SplitContainer4.Panel2.SuspendLayout()
        Me.SplitContainer4.SuspendLayout()
        CType(Me.NumericEditor1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.UltraToolbarsManager1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.UltraPanel1.ClientArea.SuspendLayout()
        Me.UltraPanel1.SuspendLayout()
        CType(Me.grdStockSummary, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.UltraGroupBox4, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.UltraGroupBox4.SuspendLayout()
        CType(Me.grdProductUpSells, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.UltraGroupBox3, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.UltraGroupBox3.SuspendLayout()
        CType(Me.grdProductPreviousSales, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.UltraGroupBox2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.UltraGroupBox2.SuspendLayout()
        CType(Me.grdCustomerPreviousSales, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.UltraGroupBox1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.UltraGroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'SplitContainer1
        '
        Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.SplitContainer1.Location = New System.Drawing.Point(0, 0)
        Me.SplitContainer1.Name = "SplitContainer1"
        Me.SplitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal
        '
        'SplitContainer1.Panel1
        '
        Me.SplitContainer1.Panel1.Controls.Add(Me.UltraGroupBox1)
        '
        'SplitContainer1.Panel2
        '
        Me.SplitContainer1.Panel2.Controls.Add(Me.SplitContainer2)
        Me.SplitContainer1.Size = New System.Drawing.Size(376, 575)
        Me.SplitContainer1.SplitterDistance = 154
        Me.SplitContainer1.TabIndex = 1
        '
        'SplitContainer2
        '
        Me.SplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.SplitContainer2.Location = New System.Drawing.Point(0, 0)
        Me.SplitContainer2.Name = "SplitContainer2"
        Me.SplitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal
        '
        'SplitContainer2.Panel1
        '
        Me.SplitContainer2.Panel1.Controls.Add(Me.UltraGroupBox2)
        '
        'SplitContainer2.Panel2
        '
        Me.SplitContainer2.Panel2.Controls.Add(Me.SplitContainer3)
        Me.SplitContainer2.Size = New System.Drawing.Size(376, 417)
        Me.SplitContainer2.SplitterDistance = 109
        Me.SplitContainer2.TabIndex = 0
        '
        'SplitContainer3
        '
        Me.SplitContainer3.Dock = System.Windows.Forms.DockStyle.Fill
        Me.SplitContainer3.Location = New System.Drawing.Point(0, 0)
        Me.SplitContainer3.Name = "SplitContainer3"
        Me.SplitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal
        '
        'SplitContainer3.Panel1
        '
        Me.SplitContainer3.Panel1.Controls.Add(Me.UltraGroupBox3)
        '
        'SplitContainer3.Panel2
        '
        Me.SplitContainer3.Panel2.Controls.Add(Me.SplitContainer4)
        Me.SplitContainer3.Size = New System.Drawing.Size(376, 304)
        Me.SplitContainer3.SplitterDistance = 95
        Me.SplitContainer3.TabIndex = 0
        '
        'SplitContainer4
        '
        Me.SplitContainer4.Dock = System.Windows.Forms.DockStyle.Fill
        Me.SplitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2
        Me.SplitContainer4.Location = New System.Drawing.Point(0, 0)
        Me.SplitContainer4.Name = "SplitContainer4"
        Me.SplitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal
        '
        'SplitContainer4.Panel1
        '
        Me.SplitContainer4.Panel1.Controls.Add(Me.UltraGroupBox4)
        '
        'SplitContainer4.Panel2
        '
        Me.SplitContainer4.Panel2.Controls.Add(Me.UltraLabel1)
        Me.SplitContainer4.Panel2.Controls.Add(Me.NumericEditor1)
        Me.SplitContainer4.Size = New System.Drawing.Size(376, 205)
        Me.SplitContainer4.SplitterDistance = 156
        Me.SplitContainer4.TabIndex = 0
        '
        'UltraLabel1
        '
        Me.UltraLabel1.Location = New System.Drawing.Point(3, 11)
        Me.UltraLabel1.Name = "UltraLabel1"
        Me.UltraLabel1.Size = New System.Drawing.Size(223, 17)
        Me.UltraLabel1.TabIndex = 1
        Me.UltraLabel1.Text = "Number of days to Show Sales History for :"
        '
        'NumericEditor1
        '
        Me.NumericEditor1.DecimalPlaces = 0
        Me.NumericEditor1.Location = New System.Drawing.Point(228, 7)
        Me.NumericEditor1.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw
        Me.NumericEditor1.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals
        Me.NumericEditor1.MaskInput = "-nnn,nnn,nnn,nnn,nnn"
        Me.NumericEditor1.MaxValue = 9999999999999.99R
        Me.NumericEditor1.Name = "NumericEditor1"
        Me.NumericEditor1.NumericType = Infragistics.Win.UltraWinEditors.NumericType.[Decimal]
        Me.NumericEditor1.PromptChar = Global.Microsoft.VisualBasic.ChrW(32)
        Me.NumericEditor1.Size = New System.Drawing.Size(47, 21)
        Me.NumericEditor1.TabIndex = 0
        Me.NumericEditor1.TabNavigation = Infragistics.Win.UltraWinMaskedEdit.MaskedEditTabNavigation.NextControl
        Me.NumericEditor1.ThousandsSeparator = True
        Me.NumericEditor1.ThousandsSeparatorChar = Global.Microsoft.VisualBasic.ChrW(44)
        Me.NumericEditor1.Value = New Decimal(New Integer() {900, 0, 0, 0})
        '
        'UltraToolbarsManager1
        '
        Me.UltraToolbarsManager1.DesignerFlags = 1
        Me.UltraToolbarsManager1.DockWithinContainer = Me
        Me.UltraToolbarsManager1.DockWithinContainerBaseType = GetType(System.Windows.Forms.Form)
        UltraToolbar1.DockedColumn = 0
        UltraToolbar1.DockedRow = 0
        UltraToolbar1.IsMainMenuBar = True
        UltraToolbar1.NonInheritedTools.AddRange(New Infragistics.Win.UltraWinToolbars.ToolBase() {PopupMenuTool1})
        UltraToolbar1.Text = "ViewMenu"
        Me.UltraToolbarsManager1.Toolbars.AddRange(New Infragistics.Win.UltraWinToolbars.UltraToolbar() {UltraToolbar1})
        PopupMenuTool2.SharedPropsInternal.Caption = "View"
        PopupMenuTool2.Tools.AddRange(New Infragistics.Win.UltraWinToolbars.ToolBase() {StateButtonTool1, StateButtonTool2, StateButtonTool3, StateButtonTool4})
        StateButtonTool5.SharedPropsInternal.Caption = "Customers Previous Sales"
        StateButtonTool6.SharedPropsInternal.Caption = "Product Sales History"
        StateButtonTool7.SharedPropsInternal.Caption = "Product Upsells"
        StateButtonTool8.SharedPropsInternal.Caption = "Stock Summary"
        Me.UltraToolbarsManager1.Tools.AddRange(New Infragistics.Win.UltraWinToolbars.ToolBase() {PopupMenuTool2, StateButtonTool5, StateButtonTool6, StateButtonTool7, StateButtonTool8})
        '
        '_CustomerPanel_Toolbars_Dock_Area_Left
        '
        Me._CustomerPanel_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping
        Me._CustomerPanel_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control
        Me._CustomerPanel_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left
        Me._CustomerPanel_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText
        Me._CustomerPanel_Toolbars_Dock_Area_Left.Location = New System.Drawing.Point(0, 21)
        Me._CustomerPanel_Toolbars_Dock_Area_Left.Name = "_CustomerPanel_Toolbars_Dock_Area_Left"
        Me._CustomerPanel_Toolbars_Dock_Area_Left.Size = New System.Drawing.Size(0, 575)
        Me._CustomerPanel_Toolbars_Dock_Area_Left.ToolbarsManager = Me.UltraToolbarsManager1
        '
        '_CustomerPanel_Toolbars_Dock_Area_Right
        '
        Me._CustomerPanel_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping
        Me._CustomerPanel_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control
        Me._CustomerPanel_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right
        Me._CustomerPanel_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText
        Me._CustomerPanel_Toolbars_Dock_Area_Right.Location = New System.Drawing.Point(376, 21)
        Me._CustomerPanel_Toolbars_Dock_Area_Right.Name = "_CustomerPanel_Toolbars_Dock_Area_Right"
        Me._CustomerPanel_Toolbars_Dock_Area_Right.Size = New System.Drawing.Size(0, 575)
        Me._CustomerPanel_Toolbars_Dock_Area_Right.ToolbarsManager = Me.UltraToolbarsManager1
        '
        '_CustomerPanel_Toolbars_Dock_Area_Top
        '
        Me._CustomerPanel_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping
        Me._CustomerPanel_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control
        Me._CustomerPanel_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top
        Me._CustomerPanel_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText
        Me._CustomerPanel_Toolbars_Dock_Area_Top.Location = New System.Drawing.Point(0, 0)
        Me._CustomerPanel_Toolbars_Dock_Area_Top.Name = "_CustomerPanel_Toolbars_Dock_Area_Top"
        Me._CustomerPanel_Toolbars_Dock_Area_Top.Size = New System.Drawing.Size(376, 21)
        Me._CustomerPanel_Toolbars_Dock_Area_Top.ToolbarsManager = Me.UltraToolbarsManager1
        '
        '_CustomerPanel_Toolbars_Dock_Area_Bottom
        '
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.Location = New System.Drawing.Point(0, 596)
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.Name = "_CustomerPanel_Toolbars_Dock_Area_Bottom"
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.Size = New System.Drawing.Size(376, 0)
        Me._CustomerPanel_Toolbars_Dock_Area_Bottom.ToolbarsManager = Me.UltraToolbarsManager1
        '
        'UltraPanel1
        '
        '
        'UltraPanel1.ClientArea
        '
        Me.UltraPanel1.ClientArea.Controls.Add(Me.SplitContainer1)
        Me.UltraPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.UltraPanel1.Location = New System.Drawing.Point(0, 21)
        Me.UltraPanel1.Name = "UltraPanel1"
        Me.UltraPanel1.Size = New System.Drawing.Size(376, 575)
        Me.UltraPanel1.TabIndex = 1
        '
        'grdStockSummary
        '
        Me.grdStockSummary.AccessibleDescription = ""
        Me.grdStockSummary.AllowColumnMove = True
        Me.grdStockSummary.AllowColumnMoveMultiple = True
        Me.grdStockSummary.AllowSorting = True
        Me.grdStockSummary.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentRow
        Me.grdStockSummary.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.ColumnHeaders
        Me.grdStockSummary.Dock = System.Windows.Forms.DockStyle.Fill
        Me.grdStockSummary.EditModePermanent = True
        Me.grdStockSummary.EditModeReplace = True
        Me.grdStockSummary.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        Me.grdStockSummary.Location = New System.Drawing.Point(3, 16)
        Me.grdStockSummary.Name = "grdStockSummary"
        Me.grdStockSummary.RetainSelectionBlock = False
        Me.grdStockSummary.ScrollBarTrackPolicy = FarPoint.Win.Spread.ScrollBarTrackPolicy.Both
        Me.grdStockSummary.selectedCellRanges = Nothing
        Me.grdStockSummary.Size = New System.Drawing.Size(370, 137)
        Me.grdStockSummary.SourceCollection = Nothing
        Me.grdStockSummary.TabIndex = 0
        Me.grdStockSummary.TypeCurrencyDecimalPlaces = New Decimal(New Integer() {2, 0, 0, 0})
        Me.grdStockSummary.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        grdStockSummary_InputMapWhenAncestorOfFocusedNormal.Put(New FarPoint.Win.Spread.Keystroke(System.Windows.Forms.Keys.Delete, System.Windows.Forms.Keys.None), "DeleteKey")
        Me.grdStockSummary.SetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused, FarPoint.Win.Spread.OperationMode.Normal, grdStockSummary_InputMapWhenAncestorOfFocusedNormal)
        '
        'UltraGroupBox4
        '
        Me.UltraGroupBox4.Controls.Add(Me.grdStockSummary)
        Me.UltraGroupBox4.Dock = System.Windows.Forms.DockStyle.Fill
        Me.UltraGroupBox4.Location = New System.Drawing.Point(0, 0)
        Me.UltraGroupBox4.Name = "UltraGroupBox4"
        Me.UltraGroupBox4.Size = New System.Drawing.Size(376, 156)
        Me.UltraGroupBox4.TabIndex = 0
        Me.UltraGroupBox4.Text = "Stock Summary"
        '
        'grdProductUpSells
        '
        Me.grdProductUpSells.AccessibleDescription = ""
        Me.grdProductUpSells.AllowColumnMove = True
        Me.grdProductUpSells.AllowColumnMoveMultiple = True
        Me.grdProductUpSells.AllowSorting = True
        Me.grdProductUpSells.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentRow
        Me.grdProductUpSells.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.ColumnHeaders
        Me.grdProductUpSells.Dock = System.Windows.Forms.DockStyle.Fill
        Me.grdProductUpSells.EditModePermanent = True
        Me.grdProductUpSells.EditModeReplace = True
        Me.grdProductUpSells.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        Me.grdProductUpSells.Location = New System.Drawing.Point(3, 16)
        Me.grdProductUpSells.Name = "grdProductUpSells"
        Me.grdProductUpSells.RetainSelectionBlock = False
        Me.grdProductUpSells.ScrollBarTrackPolicy = FarPoint.Win.Spread.ScrollBarTrackPolicy.Both
        Me.grdProductUpSells.selectedCellRanges = Nothing
        Me.grdProductUpSells.Size = New System.Drawing.Size(370, 76)
        Me.grdProductUpSells.SourceCollection = Nothing
        Me.grdProductUpSells.TabIndex = 0
        Me.grdProductUpSells.TypeCurrencyDecimalPlaces = New Decimal(New Integer() {2, 0, 0, 0})
        Me.grdProductUpSells.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        grdProductUpSells_InputMapWhenAncestorOfFocusedNormal.Put(New FarPoint.Win.Spread.Keystroke(System.Windows.Forms.Keys.Delete, System.Windows.Forms.Keys.None), "DeleteKey")
        Me.grdProductUpSells.SetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused, FarPoint.Win.Spread.OperationMode.Normal, grdProductUpSells_InputMapWhenAncestorOfFocusedNormal)
        '
        'UltraGroupBox3
        '
        Me.UltraGroupBox3.Controls.Add(Me.grdProductUpSells)
        Me.UltraGroupBox3.Dock = System.Windows.Forms.DockStyle.Fill
        Me.UltraGroupBox3.Location = New System.Drawing.Point(0, 0)
        Me.UltraGroupBox3.Name = "UltraGroupBox3"
        Me.UltraGroupBox3.Size = New System.Drawing.Size(376, 95)
        Me.UltraGroupBox3.TabIndex = 0
        Me.UltraGroupBox3.Text = "Product Upsells"
        '
        'grdProductPreviousSales
        '
        Me.grdProductPreviousSales.AccessibleDescription = ""
        Me.grdProductPreviousSales.AllowColumnMove = True
        Me.grdProductPreviousSales.AllowColumnMoveMultiple = True
        Me.grdProductPreviousSales.AllowSorting = True
        Me.grdProductPreviousSales.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentRow
        Me.grdProductPreviousSales.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.ColumnHeaders
        Me.grdProductPreviousSales.Dock = System.Windows.Forms.DockStyle.Fill
        Me.grdProductPreviousSales.EditModePermanent = True
        Me.grdProductPreviousSales.EditModeReplace = True
        Me.grdProductPreviousSales.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        Me.grdProductPreviousSales.Location = New System.Drawing.Point(3, 16)
        Me.grdProductPreviousSales.Name = "grdProductPreviousSales"
        Me.grdProductPreviousSales.RetainSelectionBlock = False
        Me.grdProductPreviousSales.ScrollBarTrackPolicy = FarPoint.Win.Spread.ScrollBarTrackPolicy.Both
        Me.grdProductPreviousSales.selectedCellRanges = Nothing
        Me.grdProductPreviousSales.Size = New System.Drawing.Size(370, 90)
        Me.grdProductPreviousSales.SourceCollection = Nothing
        Me.grdProductPreviousSales.TabIndex = 0
        Me.grdProductPreviousSales.TypeCurrencyDecimalPlaces = New Decimal(New Integer() {2, 0, 0, 0})
        Me.grdProductPreviousSales.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        grdProductPreviousSales_InputMapWhenAncestorOfFocusedNormal.Put(New FarPoint.Win.Spread.Keystroke(System.Windows.Forms.Keys.Delete, System.Windows.Forms.Keys.None), "DeleteKey")
        Me.grdProductPreviousSales.SetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused, FarPoint.Win.Spread.OperationMode.Normal, grdProductPreviousSales_InputMapWhenAncestorOfFocusedNormal)
        '
        'UltraGroupBox2
        '
        Me.UltraGroupBox2.Controls.Add(Me.grdProductPreviousSales)
        Me.UltraGroupBox2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.UltraGroupBox2.Location = New System.Drawing.Point(0, 0)
        Me.UltraGroupBox2.Name = "UltraGroupBox2"
        Me.UltraGroupBox2.Size = New System.Drawing.Size(376, 109)
        Me.UltraGroupBox2.TabIndex = 0
        Me.UltraGroupBox2.Text = "Product Sales History"
        '
        'grdCustomerPreviousSales
        '
        Me.grdCustomerPreviousSales.AccessibleDescription = ""
        Me.grdCustomerPreviousSales.AllowColumnMove = True
        Me.grdCustomerPreviousSales.AllowColumnMoveMultiple = True
        Me.grdCustomerPreviousSales.AllowSorting = True
        Me.grdCustomerPreviousSales.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.CurrentRow
        Me.grdCustomerPreviousSales.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.ColumnHeaders
        Me.grdCustomerPreviousSales.Dock = System.Windows.Forms.DockStyle.Fill
        Me.grdCustomerPreviousSales.EditModePermanent = True
        Me.grdCustomerPreviousSales.EditModeReplace = True
        Me.grdCustomerPreviousSales.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        Me.grdCustomerPreviousSales.Location = New System.Drawing.Point(3, 16)
        Me.grdCustomerPreviousSales.Name = "grdCustomerPreviousSales"
        Me.grdCustomerPreviousSales.RetainSelectionBlock = False
        Me.grdCustomerPreviousSales.ScrollBarTrackPolicy = FarPoint.Win.Spread.ScrollBarTrackPolicy.Both
        Me.grdCustomerPreviousSales.selectedCellRanges = Nothing
        Me.grdCustomerPreviousSales.Size = New System.Drawing.Size(370, 135)
        Me.grdCustomerPreviousSales.SourceCollection = Nothing
        Me.grdCustomerPreviousSales.TabIndex = 0
        Me.grdCustomerPreviousSales.TypeCurrencyDecimalPlaces = New Decimal(New Integer() {2, 0, 0, 0})
        Me.grdCustomerPreviousSales.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded
        grdCustomerPreviousSales_InputMapWhenAncestorOfFocusedNormal.Put(New FarPoint.Win.Spread.Keystroke(System.Windows.Forms.Keys.Delete, System.Windows.Forms.Keys.None), "DeleteKey")
        Me.grdCustomerPreviousSales.SetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused, FarPoint.Win.Spread.OperationMode.Normal, grdCustomerPreviousSales_InputMapWhenAncestorOfFocusedNormal)
        '
        'UltraGroupBox1
        '
        Me.UltraGroupBox1.Controls.Add(Me.grdCustomerPreviousSales)
        Me.UltraGroupBox1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.UltraGroupBox1.Location = New System.Drawing.Point(0, 0)
        Me.UltraGroupBox1.Name = "UltraGroupBox1"
        Me.UltraGroupBox1.Size = New System.Drawing.Size(376, 154)
        Me.UltraGroupBox1.TabIndex = 1
        Me.UltraGroupBox1.Text = "Customers Previous Sales"
        '
        'CustomerPanel
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(376, 596)
        Me.ControlBox = False
        Me.Controls.Add(Me.UltraPanel1)
        Me.Controls.Add(Me._CustomerPanel_Toolbars_Dock_Area_Left)
        Me.Controls.Add(Me._CustomerPanel_Toolbars_Dock_Area_Right)
        Me.Controls.Add(Me._CustomerPanel_Toolbars_Dock_Area_Bottom)
        Me.Controls.Add(Me._CustomerPanel_Toolbars_Dock_Area_Top)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "CustomerPanel"
        Me.Text = "Customer Panel"
        Me.SplitContainer1.Panel1.ResumeLayout(False)
        Me.SplitContainer1.Panel2.ResumeLayout(False)
        CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.SplitContainer1.ResumeLayout(False)
        Me.SplitContainer2.Panel1.ResumeLayout(False)
        Me.SplitContainer2.Panel2.ResumeLayout(False)
        CType(Me.SplitContainer2, System.ComponentModel.ISupportInitialize).EndInit()
        Me.SplitContainer2.ResumeLayout(False)
        Me.SplitContainer3.Panel1.ResumeLayout(False)
        Me.SplitContainer3.Panel2.ResumeLayout(False)
        CType(Me.SplitContainer3, System.ComponentModel.ISupportInitialize).EndInit()
        Me.SplitContainer3.ResumeLayout(False)
        Me.SplitContainer4.Panel1.ResumeLayout(False)
        Me.SplitContainer4.Panel2.ResumeLayout(False)
        Me.SplitContainer4.Panel2.PerformLayout()
        CType(Me.SplitContainer4, System.ComponentModel.ISupportInitialize).EndInit()
        Me.SplitContainer4.ResumeLayout(False)
        CType(Me.NumericEditor1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.UltraToolbarsManager1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.UltraPanel1.ClientArea.ResumeLayout(False)
        Me.UltraPanel1.ResumeLayout(False)
        CType(Me.grdStockSummary, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.UltraGroupBox4, System.ComponentModel.ISupportInitialize).EndInit()
        Me.UltraGroupBox4.ResumeLayout(False)
        CType(Me.grdProductUpSells, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.UltraGroupBox3, System.ComponentModel.ISupportInitialize).EndInit()
        Me.UltraGroupBox3.ResumeLayout(False)
        CType(Me.grdProductPreviousSales, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.UltraGroupBox2, System.ComponentModel.ISupportInitialize).EndInit()
        Me.UltraGroupBox2.ResumeLayout(False)
        CType(Me.grdCustomerPreviousSales, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.UltraGroupBox1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.UltraGroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

    Friend WithEvents SplitContainer1 As System.Windows.Forms.SplitContainer
    Friend WithEvents SplitContainer2 As System.Windows.Forms.SplitContainer
    Friend WithEvents SplitContainer3 As System.Windows.Forms.SplitContainer
    Friend WithEvents SplitContainer4 As System.Windows.Forms.SplitContainer
    Friend WithEvents UltraLabel1 As Infragistics.Win.Misc.UltraLabel
    Friend WithEvents NumericEditor1 As JiwaApplication.Controls.NumericEditor
    Friend WithEvents UltraToolbarsManager1 As Infragistics.Win.UltraWinToolbars.UltraToolbarsManager
    Friend WithEvents _CustomerPanel_Toolbars_Dock_Area_Left As Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea
    Friend WithEvents _CustomerPanel_Toolbars_Dock_Area_Right As Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea
    Friend WithEvents _CustomerPanel_Toolbars_Dock_Area_Top As Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea
    Friend WithEvents _CustomerPanel_Toolbars_Dock_Area_Bottom As Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea
    Friend WithEvents UltraPanel1 As Infragistics.Win.Misc.UltraPanel
    Friend WithEvents UltraGroupBox1 As Infragistics.Win.Misc.UltraGroupBox
    Friend WithEvents grdCustomerPreviousSales As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid
    Friend WithEvents UltraGroupBox2 As Infragistics.Win.Misc.UltraGroupBox
    Friend WithEvents grdProductPreviousSales As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid
    Friend WithEvents UltraGroupBox3 As Infragistics.Win.Misc.UltraGroupBox
    Friend WithEvents grdProductUpSells As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid
    Friend WithEvents UltraGroupBox4 As Infragistics.Win.Misc.UltraGroupBox
    Friend WithEvents grdStockSummary As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid
End Class
</Code>
  <ExceptionPolicy>Report</ExceptionPolicy>
  <Language>VisualBasic</Language>
  <PluginFormCollection>
    <PluginForm>
      <RecID>968d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <Description>Sales Orders</Description>
      <ClassName>JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm</ClassName>
    </PluginForm>
  </PluginFormCollection>
  <ReferenceCollection>
    <Reference>
      <RecID>978d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaSalesUI, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSalesUI.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaSalesUI.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>988d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>mscorlib.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>998d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.VisualBasic.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9a8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Xml.Linq.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9b8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaApplication, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaApplication.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaApplication.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9c8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9d8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9e8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.Misc.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.Misc.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.Misc.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9f8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinEditors.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a08d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaSales, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSales.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaSales.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a18d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinToolbars.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a28d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>FarPoint.Win.Spread, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.Spread.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\FarPoint.Win.Spread.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a38d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinTabControl.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a48d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a58d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinSchedule.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a68d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaJobCosting, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaJobCosting.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaJobCosting.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a78d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Shared.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Shared\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Shared.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a88d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Core.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a98d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Drawing.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>aa8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinStatusBar.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ab8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaODBC, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaODBC.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaODBC.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ad8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>FarPoint.Win, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\FarPoint.Win.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>af8d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaLib, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaLib.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaLib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b08d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaPriceSchemes, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaPriceSchemes.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaPriceSchemes.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b28d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Infragistics4.Shared.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Shared.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Infragistics4.Shared.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b48d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Data.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b58d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>JiwaSerialNumbersUI, Version=7.0.167.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSerialNumbersUI.dll</AssemblyName>
      <AssemblyLocation>C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaSerialNumbersUI.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b68d2bc3-850b-e311-be7f-001b216d693f</RecID>
      <AssemblyFullName>Microsoft.VisualBasic.Compatibility, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.VisualBasic.Compatibility.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic.Compatibility\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.Compatibility.dll</AssemblyLocation>
    </Reference>
  </ReferenceCollection>
</JiwaDocument>