﻿<?xml version="1.0" encoding="utf-16"?>
<JiwaDocument xmlns:jiwa="http://www.jiwa.com.au/xml/schemas" Type="JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin">
  <RecID>28eb584a-2d95-4573-8e57-7c860a127471</RecID>
  <Name>Sales Order Custom Email - Obtain To and CC address from a stored proc</Name>
  <Description>Customises the email sent from a sales order - calls a stored procedure to obtain the TO and CC email address fields.&amp;#13;&amp;#10;&amp;#13;&amp;#10;Attached to plugin on the documents tab is the SQL script to create the stored procedure.</Description>
  <IsEnabled>true</IsEnabled>
  <IsIsolatedToOwnAppDomain>false</IsIsolatedToOwnAppDomain>
  <ExecutionOrder>0</ExecutionOrder>
  <Author>Jiwa Financials</Author>
  <Version>7.0.144.0</Version>
  <Code>Imports JiwaFinancials.Jiwa
Imports System.Data.SqlClient
	
Public Class FormPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaFormPlugin
	

    Overrides Public 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
		Dim salesOrderForm As JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm = JiwaForm
		AddHandler salesOrderForm.UltraToolbarsManager1.ToolClick, AddressOf UltraToolbarsManager1_ToolClick
    End Sub

    Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
    End Sub

	Private Sub UltraToolbarsManager1_ToolClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
	    Select Case e.Tool.Key
	        Case "ID_RecordEmail"
				Dim salesOrderForm As JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm = DirectCast(sender, Infragistics.Win.UltraWinToolbars.UltraToolbarsManager).DockWithinContainer
				EmailSalesOrder(salesOrderForm)
				Throw New JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException 
		End Select
	End Sub
	
	Private Sub EmailSalesOrder(ByVal SalesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm,  Optional ByVal ExportFormatType As CrystalDecisions.Shared.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)		
        If salesOrderForm.SalesOrder.ChangeFlag Or salesOrderForm.SalesOrder.InsertFlag Then
            Throw New System.Exception("Cannot email a sales order until the changes have been saved.")
        End If

        If salesOrderForm.GetAbstractPermission("sales order - email invoices") &lt;&gt; JiwaApplication.Security.UserGroup.AccessLevels.Allow Then
            Throw New System.Exception("You do not have sufficient priveleges to email an invoice.")
        End If

        If salesOrderForm.SalesOrder.SalesOrderReports.Count = 0 Then
            If Microsoft.VisualBasic.Interaction.MsgBox("No sales order reports have been defined." &amp; System.Environment.NewLine &amp; System.Environment.NewLine &amp; "Would you like to set some up now ?", Microsoft.VisualBasic.MsgBoxStyle.YesNo , "No Sales Order Reports Configured") = Microsoft.VisualBasic.MsgBoxResult.Yes Then
                salesOrderForm.PrinterSetup()
            Else
                Throw New JiwaApplication.Exceptions.ClientCancelledException
            End If
        End If

        Dim candidateReports As JiwaApplication.JiwaCollection(Of JiwaApplication.PrintGroup.SalesOrderReports.SalesOrderReport) = salesOrderForm.SalesOrder.GetCandidateReportsToEmail()

        If candidateReports.Count = 0 Then
            Throw New System.Exception("There are no reports that are applicable to this particular invoice.")
        End If
        ' load print selection dialog        
		Dim emailReportDialog As JiwaSalesUI.SalesOrder.EmailReport = JiwaApplication.Manager.Instance.DialogFactory.CreateDialog(Of JiwaSalesUI.SalesOrder.EmailReport)(New Object() {candidateReports}, SalesOrderForm, "Sales Order Entry")
        emailReportDialog.NameToGiveAttachment = salesOrderForm.SalesOrder.InvoiceNo &amp; "-D0" &amp; salesOrderForm.SalesOrder.SelectedHistoryNo
		
		'Make filename safe
		For Each c As Char In System.IO.Path.GetInvalidFileNameChars
		    emailReportDialog.NameToGiveAttachment = emailReportDialog.NameToGiveAttachment.Replace(c, "")
		Next
        
		Dim debtor As JiwaDebtors.Debtor = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaDebtors.Debtor)(Nothing)
		debtor.Read(salesOrderForm.SalesOrder.Debtor.RecID)
		
		' Call spEmailAddress stored proc to obtain TO address		
        emailReportDialog.EmailTo = GetEmailAddress(salesOrderForm.SalesOrder.Debtor.RecID, "Email Invoice")
		If emailReportDialog.EmailTo.Trim.Length = 0 Then
			Throw New System.Exception("No email address on file. Email cancelled")
		End If
		
		' Call spEmailAddress stored proc to obtain CC address
		emailReportDialog.CC = GetEmailAddress(salesOrderForm.SalesOrder.Debtor.RecID, "CC Email Invoice")
		       
		Dim useOutlookForEmail As Boolean  = CBool(JiwaApplication.Manager.Instance.Database.ReadSysData("System", "UseOutlookForEmail", False))

		If useOutlookForEmail Then
			emailReportDialog.From = Microsoft.VisualBasic.Strings.Chr(34) &amp; Microsoft.VisualBasic.Strings.Replace(JiwaApplication.Manager.Instance.Staff.EmailDisplayName, "@", " ") &amp; Microsoft.VisualBasic.Strings.Chr(34) &amp; " &lt;" &amp; JiwaApplication.Manager.Instance.Staff.EmailAddress &amp; "&gt;"
		Else
			emailReportDialog.From = JiwaApplication.Manager.Instance.Staff.EmailAddress
		End If
        
        emailReportDialog.Subject = "Invoice From Advanced Seed"
        emailReportDialog.SelectedReport = candidateReports(1)
			
		emailReportDialog.Message = String.Format("Thank you For your order. Please find our invoice attached.{0}{0}Kind Regards{0}{0}{1}", System.Environment.NewLine, JiwaApplication.Manager.Instance.Staff.FullName)		

        If emailReportDialog.ShowDialog(salesOrderForm) = System.Windows.Forms.DialogResult.OK Then
            salesOrderForm.SalesOrder.Email(emailReportDialog.SelectedReport, emailReportDialog.NameToGiveAttachment, emailReportDialog.From, emailReportDialog.EmailTo, emailReportDialog.RequestReadReceipt, emailReportDialog.Subject, emailReportDialog.CC, emailReportDialog.BCC, emailReportDialog.Message, ExportFormatType)
        End If

    End Sub
	
	Public Function GetEmailAddress(ByVal DebtorID As String, ByVal ContactPosition As String) As String
		Dim SQLReader As SqlDataReader = Nothing
        Dim SQLParam As SqlParameter = Nothing

        Try
            With JiwaApplication.Manager.Instance.Database
                Using SQLCmd As SqlCommand = New SqlCommand("spEmailAddress", .SQLConnection, .SQLTransaction)					
                    SQLCmd.CommandType = System.Data.CommandType.StoredProcedure
                    SQLCmd.CommandTimeout = JiwaApplication.Manager.Instance.Database.DefaultCommandTimeout

                    SQLParam = New SqlParameter("@DebtorID", System.Data.SqlDbType.Char)
                    SQLParam.Value = DebtorID
                    SQLCmd.Parameters.Add(SQLParam)

					SQLParam = New SqlParameter("@Position", System.Data.SqlDbType.VarChar)
                    SQLParam.Value = ContactPosition
                    SQLCmd.Parameters.Add(SQLParam)
					
                    SQLReader = SQLCmd.ExecuteReader()

                    If SQLReader.Read = True Then
                        Return .Sanitise(SQLReader, "EmailAddress").ToString
                    End If

                    SQLReader.Close()
                End Using
            End With

        Finally
            If Not SQLReader Is Nothing Then
                SQLReader.Close()
            End If
        End Try
		
		Return ""
	End Function
End Class

Public Class BusinessLogicPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaBusinessLogicPlugin

    Overrides Public Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub Setup(ByVal JiwaBusinessLogic As JiwaApplication.IJiwaBusinessLogic, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaBusinessLogicPlugin.Setup
    End Sub

End Class

Public Class ApplicationManagerPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaApplicationManagerPlugin

    Overrides Public Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub Setup(ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaApplicationManagerPlugin.Setup
    End Sub

End Class

Public Class CustomFieldPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaCustomFieldPlugin

    Overrides Public Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.FormatCell
    End Sub

    Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ReadData
    End Sub

    Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostObject As JiwaApplication.IJiwaCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaCustomFieldPlugin.ButtonClicked
    End Sub

End Class

Public Class LineCustomFieldPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaLineCustomFieldPlugin

    Overrides Public Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.FormatCell
    End Sub

    Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.ReadData
    End Sub

    Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal HostItem As JiwaApplication.IJiwaLineCustomFieldValues, ByVal CustomField As JiwaApplication.CustomFields.CustomField, ByVal CustomFieldValue As JiwaApplication.CustomFields.CustomFieldValue) Implements JiwaApplication.IJiwaLineCustomFieldPlugin.ButtonClicked
    End Sub

End Class

Public Class SystemSettingPlugin
    Inherits System.MarshalByRefObject
    Implements JiwaApplication.IJiwaSystemSettingPlugin

    Public Overrides Function InitializeLifetimeService() As Object
        ' returning null here will prevent the lease manager
        ' from deleting the Object.
        Return Nothing
    End Function

    Public Sub FormatCell(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.FormatCell
    End Sub

    Public Sub ReadData(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ReadData
    End Sub

    Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ButtonClicked
    End Sub

End Class</Code>
  <ExceptionPolicy>Report</ExceptionPolicy>
  <Language>VisualBasic</Language>
  <PluginFormCollection>
    <PluginForm>
      <RecID>e101dd91-cd22-43d7-8c8d-efcde22b7d76</RecID>
      <Description>Sales Orders</Description>
      <ClassName>JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm</ClassName>
    </PluginForm>
  </PluginFormCollection>
  <ReferenceCollection>
    <Reference>
      <RecID>08f3a833-6a58-4fbf-bd91-f59cd71dc73e</RecID>
      <AssemblyFullName>JiwaApplication, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaApplication.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaApplication.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>0b9a780d-9262-4544-880c-4b4ea4d800bb</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>4f2ef01f-6286-4ae3-9f4b-4ba8edf13862</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>3fa24126-b0c0-440a-8e56-e076fdf5456c</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>aa8a65ac-7491-4573-8eca-00890466e9da</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>4cc53167-4fe5-42f4-a7d7-1280e2818904</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinToolbars.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>32b96d80-f4ec-4252-804c-9a2d4a76dd5c</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.Misc.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.Misc.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>365d067b-8574-47f9-8e46-7f90768cb4c7</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinStatusBar.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>6dc11458-2daf-4c28-94c9-37ebb4561cec</RecID>
      <AssemblyFullName>FarPoint.Win.Spread, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.Spread.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\FarPoint.Win.Spread\8.35.20151.0__327c3516b1b18457\FarPoint.Win.Spread.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e378bb3d-76ee-481f-94df-3c12ce35c338</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinTabControl.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1d46737e-caa8-4c18-ba7e-d5c1e45a9ddd</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>971c0b47-a3ff-4f5e-95d9-1aeb8cec39d2</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>3fc6e33f-8ca0-45a8-89b4-6ad96e8b6425</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b15dadb4-c54d-4b9a-92ba-8a25538d1b11</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinEditors.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>4ce61bef-ef58-439e-8d4e-5aef24dfd670</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinExplorerBar.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinExplorerBar.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>575a94d7-1ac1-453d-b21b-cbea331ca226</RecID>
      <AssemblyFullName>System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Xml.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>396e52a9-fde7-4dbd-9c8b-eabc47e8fc0e</RecID>
      <AssemblyFullName>CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.CrystalReports.Engine.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\13.0.2000.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>19097a1a-ce24-49d1-87dc-4e6c0b9fd3e2</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>976f3373-e96d-4c6b-8c80-d5bd04b455cb</RecID>
      <AssemblyFullName>CrystalDecisions.Windows.Forms, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\CrystalDecisions.Windows.Forms\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9763c5d8-83f4-47e8-8c6d-71ffc440d3fa</RecID>
      <AssemblyFullName>Infragistics4.Win.AppStylistSupport.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.AppStylistSupport.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>907a97d3-273a-49f8-8087-264645892019</RecID>
      <AssemblyFullName>JiwaODBC, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaODBC.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaODBC.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>970cd3ea-19bf-4cdd-a969-8170995c8c63</RecID>
      <AssemblyFullName>JiwaLib, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaLib.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaLib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e9f4abd8-8581-4590-82f9-5cae346b13b6</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinGrid.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinGrid.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>41ea0e4d-48e8-4672-946d-a73b6a587e85</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Shared.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Shared.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c855438b-a47f-4842-af68-79dcec9ac8ac</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinTree.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinTree.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c8a3393f-8699-4372-b463-1348d5000ac2</RecID>
      <AssemblyFullName>JiwaEncryption, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaEncryption.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaEncryption.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>80e8780f-ac63-4ed5-9ec3-c9e4d487b17e</RecID>
      <AssemblyFullName>JiwaSendEmail, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSendEmail.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaSendEmail.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>16abb007-b882-4e75-b48d-7a067b38e1f0</RecID>
      <AssemblyFullName>System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Management.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Management.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5cd84f83-19b2-4847-b90b-a53fefd217e1</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>242438de-874b-464e-88bd-89d084cb7bc1</RecID>
      <AssemblyFullName>FarPoint.Win, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.dll</AssemblyName>
      <AssemblyLocation>C:\windows\assembly\GAC_MSIL\FarPoint.Win\8.35.20151.0__327c3516b1b18457\FarPoint.Win.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ea8dc4e3-d1d2-48b7-9af9-f20ed6a4e310</RecID>
      <AssemblyFullName>System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Security.dll</AssemblyName>
      <AssemblyLocation>C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Security\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c7094fcd-4d94-4325-add0-0878c2c2fa11</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:\windows\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinSchedule.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e426cb82-20fb-4451-af97-ec82a0b90198</RecID>
      <AssemblyFullName>JiwaSalesUI, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSalesUI.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaSalesUI.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>8d2cce22-991c-450b-b20e-028128b1e7d4</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>38c34f98-3670-489d-9390-263590c1b36c</RecID>
      <AssemblyFullName>JiwaSales, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSales.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaSales.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e8198855-e63a-44c7-abc9-66fd21119264</RecID>
      <AssemblyFullName>JiwaJobCosting, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaJobCosting.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaJobCosting.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>66d5ae0d-de12-43cd-9264-576d5fd040b7</RecID>
      <AssemblyFullName>JiwaPriceSchemes, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaPriceSchemes.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaPriceSchemes.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a2b8811a-2c7f-442a-a341-8dbddb472b5e</RecID>
      <AssemblyFullName>JiwaSerialNumbersUI, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaSerialNumbersUI.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaSerialNumbersUI.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1446eff1-8f05-4072-99c3-092311c24382</RecID>
      <AssemblyFullName>JiwaDebtors, Version=7.0.144.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaDebtors.dll</AssemblyName>
      <AssemblyLocation>C:\VSO\Jiwa 6\Jiwa\Built Files\JiwaDebtors.dll</AssemblyLocation>
    </Reference>
  </ReferenceCollection>
  <Documents>
    <Document>
      <RecID xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">cfb85377b33b440dbcbc                </RecID>
      <DocumentType xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">
        <RecID xmlns="JiwaApplication.Documents">BB6E534C-73E3-4706-851D-80FA3661375C</RecID>
        <ItemNo xmlns="JiwaApplication.Documents">1</ItemNo>
        <Description xmlns="JiwaApplication.Documents">Default Plugin Document Type</Description>
        <DefaultType xmlns="JiwaApplication.Documents">true</DefaultType>
      </DocumentType>
      <FileID xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML" />
      <PhysicalFileName xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">spEmailAddress.sql</PhysicalFileName>
      <Description xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">Creates stored procedure.</Description>
      <LastSavedDateTime xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">2015-12-05T14:04:50.99</LastSavedDateTime>
      <LastModifiedByStaffMember xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">
        <RecID xmlns="Entities.Staff">ZZZZZZZZZZ0000000000</RecID>
        <StaffID xmlns="Entities.Staff">ZZZZZZZZZZ0000000000</StaffID>
        <UserName xmlns="Entities.Staff">Admin</UserName>
        <Title xmlns="Entities.Staff" />
        <FirstName xmlns="Entities.Staff">Admin</FirstName>
        <Surname xmlns="Entities.Staff" />
        <EmailAddress xmlns="Entities.Staff">mikes@jiwa.com.au</EmailAddress>
        <EmailDisplayName xmlns="Entities.Staff">Mike Sheen</EmailDisplayName>
        <SMTPUsername xmlns="Entities.Staff">mikes@jiwa.com.au</SMTPUsername>
        <SMTPPassword xmlns="Entities.Staff">C817116B4522B19480AE4FB798B1D1DE</SMTPPassword>
      </LastModifiedByStaffMember>
      <FileBinary xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">Q1JFQVRFIFBST0NFRFVSRSBbZGJvXS5bc3BFbWFpbEFkZHJlc3NdDQooQERlYnRvcklEIGNoYXIoMjApLA0KQFBvc2l0aW9uIHZhcmNoYXIoNTApKQ0KQVMNCg0KRGVjbGFyZSBARW1haWxBZGRyZXNzIHZhcmNoYXIoMjAwKQ0KDQpTZWxlY3QgVG9wIDEgQEVtYWlsQWRkcmVzcyA9IGNjLkVtYWlsQWRkcmVzcw0KRnJvbSBDTl9Db250YWN0IGNjLCBDTl9NYWluIGNtLCBDTl9Db250YWN0UG9zaXRpb24gY3AxDQpXaGVyZSBjYy5Qcm9zcGVjdElEID0gY20uUHJvc3BlY3RJRA0KQW5kIGNtLkRlYnRvcklEID0gQERlYnRvcklEDQpBbmQgY2MuUHJpbWFyeUlEID0gY3AxLkNvbnRhY3RQb3NpdGlvbklEDQpBbmQgY3AxLlBvc2l0aW9uID0gQFBvc2l0aW9uDQoNCklmIEBFbWFpbEFkZHJlc3MgSXMgTnVsbA0KU2VsZWN0IFRvcCAxIEBFbWFpbEFkZHJlc3MgPSBjYy5FbWFpbEFkZHJlc3MNCkZyb20gQ05fQ29udGFjdCBjYywgQ05fTWFpbiBjbSwgQ05fQ29udGFjdFBvc2l0aW9uIGNwMg0KV2hlcmUgY2MuUHJvc3BlY3RJRCA9IGNtLlByb3NwZWN0SUQNCkFuZCBjbS5EZWJ0b3JJRCA9IEBEZWJ0b3JJRA0KQW5kIGNjLlNlY29uZGFyeUlEID0gY3AyLkNvbnRhY3RQb3NpdGlvbklEDQpBbmQgY3AyLlBvc2l0aW9uID0gQFBvc2l0aW9uDQoNCklmIEBFbWFpbEFkZHJlc3MgSXMgTnVsbA0KU2VsZWN0IFRvcCAxIEBFbWFpbEFkZHJlc3MgPSBjYy5FbWFpbEFkZHJlc3MNCkZyb20gQ05fQ29udGFjdCBjYywgQ05fTWFpbiBjbSwgQ05fQ29udGFjdFBvc2l0aW9uIGNwMw0KV2hlcmUgY2MuUHJvc3BlY3RJRCA9IGNtLlByb3NwZWN0SUQNCkFuZCBjbS5EZWJ0b3JJRCA9IEBEZWJ0b3JJRA0KQW5kIGNjLlRlcnRpYXJ5SUQgPSBjcDMuQ29udGFjdFBvc2l0aW9uSUQNCkFuZCBjcDMuUG9zaXRpb24gPSBAUG9zaXRpb24NCg0KU2VsZWN0IEVtYWlsQWRkcmVzcyA9IElzTnVsbChARW1haWxBZGRyZXNzLCAnJykNCg0KR08NCg0KZ3JhbnRfYWxsX3VzZXJfdGFibGVz</FileBinary>
      <ItemNo xmlns="JiwaFinancials.Jiwa.JiwaApplication.Plugin.XML">1</ItemNo>
    </Document>
  </Documents>
</JiwaDocument>