﻿<?xml version="1.0" encoding="utf-16"?>
<JiwaDocument xmlns:jiwa="http://www.jiwa.com.au/xml/schemas" Type="JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin">
  <RecID>5042971a-d317-4ce9-af46-0547833d8b64</RecID>
  <Name>AERP - EFT UI</Name>
  <Description>Adds a button the the EFT payment batch maintenance form to allow bulk changes to exchange rates. Originally provided for the scenario where FX payments are being made in bulk by a specialist FX trader, rather than via a normal bank transaction.</Description>
  <IsEnabled>true</IsEnabled>
  <IsIsolatedToOwnAppDomain>false</IsIsolatedToOwnAppDomain>
  <ExecutionOrder>0</ExecutionOrder>
  <Author>Advanced ERP</Author>
  <Version>21.05.04.1232</Version>
  <Code>'
' Copyright(c) 2021 Advanced ERP Limited (NZ). All rights reserved.
'
' This plugin was developed for a specific customer to cover a specific requirement. 
' It may or may not be useful in other similar scenarios.
'
' Advanced ERP will entertain licensing this plugin for deployment with other customers for whom it may be suited. 
'
' Please contact us For more information.
'
' email: info@aerp.co.nz
' web site: https://www.aerp.co.nz
'
Option Explicit On
Option Infer On
Option Strict On

Imports System
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Linq
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms
Imports WinForms = System.Windows.Forms

Imports AERP.UI

Imports Infragistics.Win.UltraWinToolbars

Imports JiwaFinancials.Jiwa
Imports JiwaFinancials.Jiwa.JiwaApplication
Imports JiwaFinancials.Jiwa.JiwaApplication.Controls
Imports JiwaFinancials.Jiwa.JiwaCreditorChqPay
Imports JiwaFinancials.Jiwa.JiwaCreditorChqPayUI

Namespace AERP.EFTPaymentUILibrary

    Friend Class FxItem
        Public Property CurrencyId As String
        Public Property Currency As String
        Public Property TotalForeignValue As Decimal
        Public Property TotalLocalValue As Decimal
        Public Property ExchangeRate As Decimal
    End Class

    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

        Private Const UpdateExchangeRatesKey As String = "ID_AERP_UPDATERATES"
        Private Const UpdateRatesButtonText As String = "Update Rates"

        Dim _pluginForm As CreditorChqPay
        Dim _toolbar As UltraToolbarsManager

        Private WithEvents ProgressDialog As AERP.UI.ProgressDialog

        Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
            Me._pluginForm = DirectCast(JiwaForm, CreditorChqPay)
            Me._toolbar = Me._pluginForm.UltraToolbarsManager1

            Dim group = AddNewToolbarGroup(Me._pluginForm.UltraToolbarsManager1, "Main", "Actions", "Actions")
            AddNewToolbarButton(Plugin.Manager, Me._toolbar, group, UpdateExchangeRatesKey, UpdateRatesButtonText)

            AddHandler Me._toolbar.ToolClick, AddressOf Me.PurchaseInvoiceForm_Toolbar_ToolClick
            AddHandler Me._pluginForm.CRChequePayObject.ReadEnd, AddressOf Me.PaymentBatch_ReadEnd
        End Sub

        Private Sub PaymentBatch_ReadEnd(sender As Object, e As EventArgs)
            Dim paymentBatch As CreditorChequePayment = DirectCast(sender, CreditorChequePayment)

            If Diagnostics.Debugger.IsAttached Then Diagnostics.Debugger.Break()

            Me._toolbar.Tools(UpdateExchangeRatesKey).SharedProps.Enabled = Not paymentBatch.IsActivated AndAlso Not HaveCredits(paymentBatch)

            If Me._toolbar.Tools(UpdateExchangeRatesKey).SharedProps.Enabled Then

            End If
        End Sub

        ''' &lt;summary&gt;
        ''' Checks if the payment has any credits.
        ''' &lt;/summary&gt;
        ''' &lt;remarks&gt;
        ''' Because we don't support auto-updating the FX rate on a credit, we don't want people to try it.
        ''' &lt;/remarks&gt;
        ''' &lt;param name="paymentBatch"&gt;&lt;/param&gt;
        ''' &lt;returns&gt;&lt;/returns&gt;
        Private Shared Function HaveCredits(paymentBatch As CreditorChequePayment) As Boolean
            For Each c As Creditor In paymentBatch.Creditors
                For Each p As clsPayLineInvoice In c.InvoicePaymentLines
                    If p.Credit Then
                        Return True
                    End If
                Next
            Next

            Return False
        End Function

        Public Sub PurchaseInvoiceForm_Toolbar_ToolClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs)
            Dim toolBarManager = DirectCast(sender, Infragistics.Win.UltraWinToolbars.UltraToolbarsManager)
            Dim paymentForm = DirectCast(toolBarManager.DockWithinContainer, CreditorChqPay)
            If e.Tool.Key = UpdateExchangeRatesKey Then
                Me.UpdateRates(paymentForm, paymentForm.CRChequePayObject)
                paymentForm.RefreshRecord()
            End If
        End Sub

        Private Sub UpdateRates(form As CreditorChqPay, ByVal paymentBatch As CreditorChequePayment)
            ''
            '' because a dictionary can't be bound to a grid, we'll build a dictionary
            '' and then put it into a list for editing. The changes will be available
            '' at the end of the dialog.
            ''
            Dim currencies As New Dictionary(Of String, FxItem)
            For Each creditor As Creditor In paymentBatch.Creditors
                If Not currencies.ContainsKey(creditor.Creditor.Currency.RecID) Then
                    currencies.Add(creditor.Creditor.Currency.RecID, New FxItem() With {
                                .CurrencyId = creditor.Creditor.Currency.RecID,
                                .Currency = creditor.Creditor.Currency.ShortName,
                                .TotalForeignValue = 0,
                                .TotalLocalValue = 0,
                                .ExchangeRate = creditor.Creditor.Currency.GetTransactionRate(paymentBatch.ActivationDate)})
                End If

                currencies(creditor.Creditor.Currency.RecID).TotalForeignValue += creditor.TotalPaymentFXAmount
                currencies(creditor.Creditor.Currency.RecID).TotalLocalValue += creditor.TotalPaymentAmount
            Next

            For Each currencyItem In currencies.Values
                ' calculate the effective rate for the whole batch.
                currencyItem.ExchangeRate = currencyItem.TotalForeignValue / currencyItem.TotalLocalValue
            Next

            Dim currencyList As New List(Of FxItem)
            currencyList.AddRange(currencies.Values)

            Using ld As New SimpleListView() With {.Text = "Currencies", .ReadOnly = False}

                Dim moneyStyle As DataGridViewCellStyle = New DataGridViewCellStyle(ld.ListView.DefaultCellStyle) With {.Alignment = DataGridViewContentAlignment.BottomRight, .Format = "F2"}
                Dim rateStyle As DataGridViewCellStyle = New DataGridViewCellStyle(moneyStyle) With {.Format = "F6"}

                ld.ListView.Columns.AddRange(
                    {
                        New DataGridViewTextBoxColumn() With {.Name = "CurrencyId", .DataPropertyName = "CurrencyId", .ReadOnly = True, .HeaderText = "Currency ID", .Visible = False},
                        New DataGridViewTextBoxColumn() With {.Name = "Currency", .DataPropertyName = "Currency", .ReadOnly = True, .HeaderText = "Currency"},
                        New DataGridViewTextBoxColumn() With {.Name = "TotalForeignValue", .DataPropertyName = "TotalForeignValue", .HeaderText = "Total Foreign Value", .ValueType = GetType(Decimal), .ReadOnly = True, .DefaultCellStyle = moneyStyle},
                        New DataGridViewTextBoxColumn() With {.Name = "TotalLocalValue", .DataPropertyName = "TotalLocalValue", .HeaderText = "Total Local Value", .ValueType = GetType(Decimal), .ReadOnly = True, .DefaultCellStyle = moneyStyle},
                        New DataGridViewTextBoxColumn() With {.Name = "ExchangeRate", .DataPropertyName = "ExchangeRate", .HeaderText = "Exchange Rate To Set", .ValueType = GetType(Decimal), .ReadOnly = False, .DefaultCellStyle = rateStyle}
                    }
                )

                ld.ColumnHeadersVisible = True

                ld.DataSource = currencyList

                If ld.ShowDialog() = DialogResult.OK Then
                    Me.SetNewRates(form, paymentBatch, currencies)
                End If
            End Using
        End Sub

        Private Sub SetNewRates(form As CreditorChqPay, paymentBatch As CreditorChequePayment, currencies As Dictionary(Of String, FxItem))
            Dim invoiceLines As Integer = 0
            For Each creditor As Creditor In paymentBatch.Creditors
                If currencies.ContainsKey(creditor.Creditor.Currency.RecID) Then ' strictly speaking, it's an error if this happens.
                    invoiceLines += creditor.InvoicePaymentLines.Count
                End If
            Next

            Try
                Me.ProgressDialog = New AERP.UI.ProgressDialog(form.Form) With {
                    .Minimum = 0,
                    .Maximum = invoiceLines,
                    .BannerText = "Changing FX rates...",
                    .ProgressTextFormat = "Line {0} / {1}",
                    .Value = 0
                }

                Me.ProgressDialog.Show()
                Application.DoEvents() ' give the progressdialog a chance to refresh.

                Dim jiwaManager As JiwaApplication.Manager = form.Manager
                Dim localDecimalPlaces As Integer = paymentBatch.SystemSettings.MoneyDecimalPlaces


                Dim wasReading = paymentBatch.IsReading
                ' Stop standard calculations, checks and escalations; most of which apply to individual manual changes.
                ' Also, some of them may trigger recursive settings of values that we don't want happening.
                paymentBatch.IsReading = True

                Try
	                For Each creditor As Creditor In paymentBatch.Creditors
	                    If Not currencies.ContainsKey(creditor.Creditor.Currency.RecID) Then
	                        Me.ProgressDialog.Value += creditor.InvoicePaymentLines.Count
	                        ' panic
	                        Continue For
	                    End If

	                    Dim exchangeRate As Decimal = currencies(creditor.Creditor.Currency.RecID).ExchangeRate

                        ' sanity check because divide by 0 would be silly.
                        ' It is also Jiwa's legacy 'local currency' setting, but we won't hold it against them.
                        If Decimal.Equals(exchangeRate, Decimal.Zero) Then
                            exchangeRate = Decimal.One
                        End If

                        creditor.CurrencyRateUsedOnBatch = exchangeRate

                    	For Each pl As clsPayLineInvoice In creditor.InvoicePaymentLines
                            Try
                                ' The following logic is derived from the decompiled Jiwa code for CurrencyRateUsedOnBatch
                                ' It has been refactored from the decompiled code for legibility and performance.
                                ' make sure no standard calculations happen, we could end up in a recursive nightmare.
                                pl.SuppressCalculation = True

                                ' recalculate the local payment value
                                ' this is copied from clsPayLineInvoice.set_CurrencyRateUsedOnBatch itself
                                pl.PaymentAmount = Math.Round(pl.PaymentFXAmount / exchangeRate, localDecimalPlaces, MidpointRounding.AwayFromZero)

                                ' recalculate the local outstanding amount
                                ' this is copied from clsPayLineInvoice.set_CurrencyRateUsedOnBatch itself
                                pl.OutstandingAmount = Math.Round(pl.OutstandingFXAmount / exchangeRate, localDecimalPlaces, MidpointRounding.AwayFromZero)

                                ' this is copied from clsPayLineInvoice.set_PaymentFXAmount, which is called from clsPayLineInvoice.set_CurrencyRateUsedOnBatch
                                ' (the code in clsPayLineInvoice.set_CurrencyRateUsedOnBatch is: PaymentFXAmount = PaymentFXAmount;) 
                                ' recalculate the local "payment from bank" amount.
                                ' The standard code is intended to be driven by UI, and someone changing the amount. However, this code is *only* changing
                                ' the exchange rate, so we only need to recalculate the local value of the foreign amounts, we do not need the other calculations.
                                If pl.PaymentFromBankFXAmount &lt;&gt; pl.PaymentFXAmount Then
                                    pl.PaymentFromBankAmount = Math.Round(pl.PaymentFromBankFXAmount / exchangeRate, localDecimalPlaces, MidpointRounding.AwayFromZero)
                                Else
                                    pl.PaymentFromBankAmount = pl.PaymentAmount
                                End If

                                ' apply the balance of the payment to "payments from credits" - ususally nil.
                                ' subtracting the previously calculated values instead of multiplying by the exchange rate will reduce rounding errors when adding up.
                                ' this does not appear to be set by clsPayLineInvoice.set_CurrencyRateUsedOnBatch
                                pl.PaymentFromCreditsAmount = pl.PaymentAmount - pl.PaymentFromBankAmount

                                ' recalculate the local discounted invoice amount
                                ' this is copied from clsPayLineInvoice.set_DiscountedFXAmount, which is called from clsPayLineInvoice.set_CurrencyRateUsedOnBatch
                                ' (the code in clsPayLineInvoice.set_CurrencyRateUsedOnBatch is: DiscountedFXAmount = lDiscountedFXAmount;) 
                                pl.DiscountedAmount = Math.Round(pl.DiscountedFXAmount / exchangeRate, localDecimalPlaces, MidpointRounding.AwayFromZero)

                                ' recalculate discount amount
                                ' this is copied from clsPayLineInvoice.set_DiscountedFXAmount, which is called from clsPayLineInvoice.set_CurrencyRateUsedOnBatch
                                pl.DiscountAmount = pl.OutstandingAmount - pl.DiscountedAmount ' will avoid rounding errors if adding it back later.

                                ' recalculate GST (usually NIL for foreign payments, but technically possible under NZ tax law)
                                ' this is copied from clsPayLineInvoice.set_DiscountedFXAmount, which is called from clsPayLineInvoice.set_CurrencyRateUsedOnBatch
                                pl.GSTAmount = Math.Round(pl.DiscountAmount * pl.GSTRate / 100, localDecimalPlaces, MidpointRounding.AwayFromZero)

                                ' notify parents that we've changed.
                                ' At time of coding, doesn't actually do anything when paymentBatch.IsReading = true).
                                ' This code appears in clsPayLineInvoice.set_CurrencyRateUsedOnBatch, clsPayLineInvoice.set_PaymentFXAmount,
                                ' and clsPayLineInvoice.set_DiscountedFXAmount
                                pl.RecordMode = CreditorChequePayment.RecordModes.enumInsertUpdate

                                ' update the UI grid for this invoice line.
                                form.DisplayInvoiceLine(creditor.RecID, pl.Key)

                        		Me.ProgressDialog.Value += 1
                            Finally
                                ' allow calculations to continue. Although we don't expect any.
                                pl.SuppressCalculation = False

                            End Try

	                        ' Give the progressdialog a chance to respond to 'Cancel' being clicked.
	                        ' The 'correct' way would be to run this on a background thread,
	                        ' but this will suffice.
	                        Application.DoEvents()

	                        If Me.ProgressDialog.DialogResult = DialogResult.Cancel Then
	                            ' user has pressed the 'Cancel' button.
	                            Return
	                        End If
	                    Next pl ' payment line

                        ' Jiwa's standard exchange rate change logic includes the following. 
                        ' It won't apply to this bulk process, which does not support credits.
                        ' paymentBatch.AutoAllocateCreditsSpecificCreditor(creditor.RecID, True, False)

                        creditor.ReCalculateTotals()
                	Next creditor

                    ' Recalculate batch totals, since they'll be out by now
                    paymentBatch.CalculateTotals()

                    ' this is not ideal, but there is no public method for setting this, and we need to enable the user to save the changes.
                    Dim pbInfo As Reflection.PropertyInfo = GetType(CreditorChequePayment).GetProperty("ChangeFlag", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Public)
                    If pbInfo IsNot Nothing Then
                        pbInfo.SetValue(paymentBatch, True)
                    End If

                Catch ex As Exception
                    WinForms.MessageBox.Show(Me._pluginForm.Form, "Error setting exchange rates: " &amp; Microsoft.VisualBasic.vbCrLf &amp; ex.Message, "FX Update Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                Finally
                    paymentBatch.IsReading = wasReading
                End Try

                form.DisplayBatch()
                form.CheckEditStatus()
            Finally
                Me.ProgressDialog.Close()
                Me.ProgressDialog.Dispose()
            End Try

        End Sub
    End Class

End Namespace


Namespace AERP.UI

    Public Class SimpleListView
        Inherits Form

        Sub New()
            MyBase.New()
            InitializeComponent()
        End Sub

        Public Property DataSource As Object
            Get
                Return DialogListView.DataSource
            End Get
            Set
                DialogListView.DataSource = Value
            End Set
        End Property

        Public Property DataMember As String
            Get
                Return DialogListView.DataMember
            End Get
            Set
                DialogListView.DataMember = Value
            End Set
        End Property

        Public Property ColumnHeadersVisible As Boolean
            Get
                Return DialogListView.ColumnHeadersVisible
            End Get
            Set
                DialogListView.ColumnHeadersVisible = Value
            End Set
        End Property

        Public Property BannerText As String
            Get
                Return BannerPanel.Text
            End Get
            Set
                BannerPanel.Text = Value
            End Set
        End Property

        Public Property [ReadOnly] As Boolean
            Get
                Return DialogListView.ReadOnly
            End Get
            Set
                ListView.ReadOnly = Value
                If Not Me.ReadOnly Then
                    Me.ListView.EditMode = DataGridViewEditMode.EditOnEnter
                End If
            End Set
        End Property

        Public ReadOnly Property ListView As DataGridView
            Get
                Return DialogListView
            End Get
        End Property

        Protected Overrides Sub OnShown(e As EventArgs)
            MyBase.OnShown(e)
            If Not Me.ReadOnly Then
                Dim target As DataGridViewColumn = (From c In Me.ListView.Columns.Cast(Of DataGridViewColumn) Where c.Visible AndAlso Not c.ReadOnly).FirstOrDefault()

                If target IsNot Nothing Then
                    ' start in edit mode for the first editable cell.
                    Me.ListView.CurrentCell = Me.ListView.Rows(0).Cells(target.DisplayIndex)
                    Me.ListView.BeginEdit(True)
                End If
            End If
        End Sub

        'Form overrides dispose to clean up the component list.
        &lt;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

        Friend WithEvents ButtonPanel As Panel
        Friend WithEvents BannerPanel As Label
        Friend WithEvents DialogListView As DataGridView
        Friend WithEvents AcceptDialogButton As Button
        Friend WithEvents CancelDialogButton As Button

        '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;Diagnostics.DebuggerStepThrough()&gt;
        Private Sub InitializeComponent()
            Me.ButtonPanel = New Panel()
            Me.CancelDialogButton = New Button()
            Me.AcceptDialogButton = New Button()
            Me.BannerPanel = New Label()
            Me.DialogListView = New DataGridView()
            Me.ButtonPanel.SuspendLayout()
            CType(Me.DialogListView, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'ButtonPanel
            '
            Me.ButtonPanel.Controls.Add(Me.CancelDialogButton)
            Me.ButtonPanel.Controls.Add(Me.AcceptDialogButton)
            Me.ButtonPanel.Dock = DockStyle.Bottom
            Me.ButtonPanel.Location = New Drawing.Point(0, 215)
            Me.ButtonPanel.Name = "ButtonPanel"
            Me.ButtonPanel.Size = New Drawing.Size(476, 46)
            Me.ButtonPanel.TabIndex = 0
            '
            'CancelDialogButton
            '
            Me.CancelDialogButton.Anchor = AnchorStyles.Top
            Me.CancelDialogButton.DialogResult = DialogResult.Cancel
            Me.CancelDialogButton.Location = New Drawing.Point(242, 11)
            Me.CancelDialogButton.Name = "CancelDialogButton"
            Me.CancelDialogButton.Size = New Drawing.Size(75, 23)
            Me.CancelDialogButton.TabIndex = 1
            Me.CancelDialogButton.Text = "Cancel"
            Me.CancelDialogButton.UseVisualStyleBackColor = True
            '
            'AcceptDialogButton
            '
            Me.AcceptDialogButton.Anchor = AnchorStyles.Top
            Me.AcceptDialogButton.DialogResult = DialogResult.OK
            Me.AcceptDialogButton.Location = New Drawing.Point(160, 11)
            Me.AcceptDialogButton.Name = "AcceptDialogButton"
            Me.AcceptDialogButton.Size = New Drawing.Size(75, 23)
            Me.AcceptDialogButton.TabIndex = 0
            Me.AcceptDialogButton.Text = "OK"
            Me.AcceptDialogButton.UseVisualStyleBackColor = True
            '
            'BannerPanel
            '
            Me.BannerPanel.AutoSize = True
            Me.BannerPanel.Dock = DockStyle.Top
            Me.BannerPanel.Location = New Drawing.Point(0, 0)
            Me.BannerPanel.Name = "BannerPanel"
            Me.BannerPanel.Size = New Drawing.Size(0, 13)
            Me.BannerPanel.TabIndex = 1
            Me.BannerPanel.TextAlign = Drawing.ContentAlignment.MiddleLeft
            '
            '_ListView
            '
            Me.DialogListView.AllowUserToAddRows = False
            Me.DialogListView.AllowUserToDeleteRows = False
            Me.DialogListView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
            Me.DialogListView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
            Me.DialogListView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
            Me.DialogListView.Dock = DockStyle.Fill
            Me.DialogListView.Location = New Drawing.Point(0, 13)
            Me.DialogListView.Name = "_ListView"
            Me.DialogListView.ReadOnly = True
            Me.DialogListView.RowHeadersVisible = False
            Me.DialogListView.Size = New Drawing.Size(476, 202)
            Me.DialogListView.TabIndex = 2
            '
            'SimpleListView
            '
            Me.AcceptButton = Me.AcceptDialogButton
            Me.AutoScaleDimensions = New Drawing.SizeF(6.0!, 13.0!)
            Me.AutoScaleMode = AutoScaleMode.Font
            Me.CancelButton = Me.CancelDialogButton
            Me.ClientSize = New Drawing.Size(476, 261)
            Me.Controls.Add(Me.DialogListView)
            Me.Controls.Add(Me.BannerPanel)
            Me.Controls.Add(Me.ButtonPanel)
            Me.Name = "SimpleListView"
            Me.Text = "Results"
            Me.ButtonPanel.ResumeLayout(False)
            CType(Me.DialogListView, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub
    End Class



    Public Class ProgressDialog
        Inherits Form

        Public Event Cancelled As EventHandler

        Sub New()
            MyBase.New()

            SetupForm()
        End Sub

        Sub New(owner As Form)
            MyBase.New()
            Me.Owner = owner

            SetupForm()
        End Sub

        Protected Overridable Sub OnCancelled(ByVal sender As Object, ByVal e As EventArgs)
            DialogResult = DialogResult.Cancel
            RaiseEvent Cancelled(sender, e)
        End Sub

        Public Property Minimum As Integer
            Get
                Return ProgressBar.Minimum
            End Get
            Set
                ProgressBar.Minimum = Value
                SetProgressText()
            End Set
        End Property

        Public Property Maximum As Integer
            Get
                Return ProgressBar.Maximum
            End Get
            Set
                ProgressBar.Maximum = Value
                SetProgressText()
            End Set
        End Property

        Public Property Value As Integer
            Get
                Return ProgressBar.Value
            End Get
            Set
                ProgressBar.Value = Value
                SetProgressText()
            End Set
        End Property

        Public Property BannerText As String
            Get
                Return Title.Text
            End Get
            Set
                Title.Text = Value
                If String.IsNullOrWhiteSpace(Title.Text) Then
                    Me.Title.Size = New Drawing.Size(Me.Title.Size.Width, 1)
                Else
                    Me.Title.Size = New Drawing.Size(Me.Title.Size.Width, 30)
                End If
            End Set
        End Property

        Public Property ShowButtons As Boolean
            Get
                Return CancelDialogButton.Visible
            End Get
            Set
                Me.CancelDialogButton.Visible = Value
            End Set
        End Property

        Public Property ProgressTextFormat As String = "{0} / {1}"

        Private Sub CancelDialogButton_Click(sender As Object, e As EventArgs)
            OnCancelled(Me, e)
        End Sub
        Private Sub ProgressDialog_Shown(sender As Object, e As EventArgs)
            DialogResult = DialogResult.None
        End Sub

        Private Sub SetProgressText()
            ProgressLabel.Text = String.Format(ProgressTextFormat, Value - Minimum, Maximum - Minimum)
            Me.Refresh()
        End Sub

        Friend WithEvents Title As Label
        Friend WithEvents ProgressBar As ProgressBar
        Friend WithEvents ProgressLabel As Label
        Friend WithEvents CancelDialogButton As Button

        Private Sub SetupForm()
            Me.SuspendLayout()
            Dim ourFont As Drawing.Font = New Drawing.Font("Verdana", 9.0!)

            Me.Name = "ProgressDialog"
            Me.Font = ourFont
            Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
            Me.ClientSize = New Drawing.Size(350, 120)
            Me.StartPosition = FormStartPosition.CenterParent
            Me.ControlBox = False
            Me.TopMost = True
            Me.Text = " " ' have something to grab so that the window is movable
            '
            'BannerPanel
            '
            Me.Title = New Label With {
                .Name = "Title",
                .Text = "Title",
                .Bounds = New Drawing.Rectangle(8, 8, Me.ClientSize.Width - 18, 30),
                .TextAlign = Drawing.ContentAlignment.MiddleLeft,
                .Anchor = AnchorStyles.Left Or AnchorStyles.Right Or AnchorStyles.Top
            }
            '
            'ProgressBar
            '
            Me.ProgressBar = New ProgressBar With {
                .Name = "ProgressBar",
                .Style = ProgressBarStyle.Continuous,
                .Bounds = New Drawing.Rectangle(8, 42, Me.ClientSize.Width - 18, 30),
                .Anchor = AnchorStyles.Left Or AnchorStyles.Right
            }
            '
            ' CancelDialogButton
            ' 
            Me.CancelDialogButton = New Button With {
                .Name = "CancelDialogButton",
                .Text = "Cancel",
                .DialogResult = DialogResult.Cancel,
                .Bounds = New Drawing.Rectangle(Me.ClientSize.Width - 80, Me.ClientSize.Height - 38, 72, 30),
                .Anchor = AnchorStyles.Bottom Or AnchorStyles.Right
            }
            '
            'ProgressLabel
            '
            Me.ProgressLabel = New Label With {
                .Name = "ProgressLabel",
                .Text = "Progress",
                .Bounds = New Drawing.Rectangle(8, Me.CancelDialogButton.Top, Me.CancelDialogButton.Left - 16, Me.CancelDialogButton.Height),
                .TextAlign = Drawing.ContentAlignment.MiddleLeft,
                .Anchor = AnchorStyles.Bottom Or AnchorStyles.Right Or AnchorStyles.Left
            }
            '
            'ProgressDialog
            '
            Me.Controls.Add(Me.Title)
            Me.Controls.Add(Me.ProgressBar)
            Me.Controls.Add(Me.ProgressLabel)
            Me.Controls.Add(Me.CancelDialogButton)

            AddHandler Me.Shown, AddressOf ProgressDialog_Shown
            AddHandler Me.CancelDialogButton.Click, AddressOf CancelDialogButton_Click

            Me.ResumeLayout(False)
        End Sub

    End Class

    Public Module AerpSharedUiLibrary

        &lt;Extension()&gt;
        Public Function AddNewPopupMenuTool(toolBar As UltraToolbarsManager, group As RibbonGroup, key As String, caption As String, preferredSize As RibbonToolSize, largeImage As Image, smallImage As Image) As PopupMenuTool
            Dim newButton As New PopupMenuTool(key)
            newButton.SharedProps.Caption = caption
            toolBar.Tools.Add(newButton)
            Dim toolInstance As ToolBase = group.Tools.AddTool(key)
            toolInstance.InstanceProps.MinimumSizeOnRibbon = RibbonToolSize.Normal
            toolInstance.InstanceProps.PreferredSizeOnRibbon = preferredSize

            newButton.SharedProps.AppearancesLarge.Appearance.Image = largeImage
            newButton.SharedProps.AppearancesSmall.Appearance.Image = smallImage

            Return newButton
        End Function
      
        &lt;Extension()&gt;
        Public Function AddNewPopupMenuTool(manager As Manager, toolBar As UltraToolbarsManager, group As RibbonGroup, key As String, caption As String, Optional preferredSize As RibbonToolSize = RibbonToolSize.Normal, Optional largeImageName As String = Nothing, Optional smallImageName As String = Nothing) As PopupMenuTool
            Dim largeImage As Image = GetImage(manager, largeImageName)
            Dim smallImage As Image = If(GetImage(manager, smallImageName), largeImage)

            Return AddNewPopupMenuTool(toolBar, group, key, caption, preferredSize, largeImage, smallImage)
        End Function

        &lt;Extension()&gt;
        Public Function AddNewToolbarButton(toolBar As UltraToolbarsManager, group As RibbonGroup, key As String, caption As String, preferredSize As RibbonToolSize, largeImage As Image, smallImage As Image) As ButtonTool
            Dim newButton As New ButtonTool(key)
            newButton.SharedProps.Caption = caption
            toolBar.Tools.Add(newButton)
            Dim toolInstance As ToolBase = group.Tools.AddTool(key)
            toolInstance.InstanceProps.MinimumSizeOnRibbon = RibbonToolSize.Normal
            toolInstance.InstanceProps.PreferredSizeOnRibbon = preferredSize

            newButton.SharedProps.AppearancesLarge.Appearance.Image = largeImage
            newButton.SharedProps.AppearancesSmall.Appearance.Image = smallImage

            Return newButton
        End Function
        
        &lt;Extension()&gt;
        Public Function AddNewToolbarButton(manager As Manager, toolBar As UltraToolbarsManager, group As RibbonGroup, key As String, caption As String, Optional preferredSize As RibbonToolSize = RibbonToolSize.Normal, Optional largeImageName As String = Nothing, Optional smallImageName As String = Nothing) As ButtonTool
            Dim largeImage As Image = GetImage(manager, largeImageName)
            Dim smallImage As Image = If(GetImage(manager, smallImageName), largeImage)

            Return AddNewToolbarButton(toolBar, group, key, caption, preferredSize, largeImage, smallImage)
        End Function

        &lt;Extension()&gt;
        Public Function AddNewToolbarGroup(toolBar As UltraToolbarsManager, tabKey As String, groupKey As String, groupCaption As String) As RibbonGroup
            Dim newGroup As RibbonGroup
            Dim ribbonTab As RibbonTab

            Try
                ' if this fails, we need a new toolbar
                ribbonTab = toolBar.Ribbon.Tabs(tabKey)
            Catch ex As Exception
                ribbonTab = toolBar.Ribbon.Tabs.Add(tabKey)
            End Try

            Try
                ' if this fails, it's because the group doesn't exist, and we need to add it.
                newGroup = ribbonTab.Groups(groupKey)
            Catch ex As Exception
                newGroup = ribbonTab.Groups.Add(groupKey)
                newGroup.Caption = groupCaption
            End Try
            If newGroup Is Nothing Then

            End If

            Return newGroup
        End Function
		
    
        &lt;Extension()&gt;
        Public Function GetContrastingColor(value As Color) As Color
            Return If(value.GetBrightness() &gt; 0.5, Color.Black, Color.White)
        End Function

        Public Function GetImage(manager As Manager, imageName As String) As Image
            Return If(String.IsNullOrWhiteSpace(imageName), Nothing, manager.GetEmbeddedPicture(String.Format("JiwaFinancials.Jiwa.JiwaApplication.{0}.png", imageName), False))
        End Function
    End Module

End Namespace</Code>
  <ExceptionPolicy>Report</ExceptionPolicy>
  <Language>VisualBasic</Language>
  <PluginFormCollection>
    <PluginForm>
      <RecID>540f2d9a-9955-471c-bb61-8353f148fef9</RecID>
      <Description>Creditor Cheque Payments</Description>
      <ClassName>JiwaFinancials.Jiwa.JiwaCreditorChqPayUI.CreditorChqPay</ClassName>
    </PluginForm>
  </PluginFormCollection>
  <ReferenceCollection>
    <Reference>
      <RecID>7f8a8017-5d5e-44f4-bff4-2593681965bc</RecID>
      <AssemblyFullName>JiwaApplication, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaApplication.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaApplication.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5a92020e-aeb5-4091-86b4-5838c849d67b</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>f0f60bdf-e137-49d8-bebd-6b97fed92da2</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>a69284b5-4a86-41af-8cd1-8fdcb070c436</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>bfa19275-1cb8-42b9-83d0-7c86b08d21b6</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>a6c970df-1a55-4a05-9ea6-33b6f5f30144</RecID>
      <AssemblyFullName>JiwaODBC, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaODBC.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaODBC.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>2286e9cc-11ff-4dca-8405-11325fd76930</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>0a1cfb84-f4d3-40fa-baef-af25b944522e</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>028d862a-3638-4372-97ce-777fede76caf</RecID>
      <AssemblyFullName>System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Runtime.Serialization.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>6837823d-e025-4eb5-9f0e-475ee56ce022</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>98c1b538-ac35-4ec0-a591-c6b434e103eb</RecID>
      <AssemblyFullName>JiwaServiceModel, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaServiceModel.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaServiceModel.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d7dc7680-693c-4df2-8b1d-665bf443fb32</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:\Jiwa\Jiwa 7\Infragistics4.Win.Misc.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>318daf2a-2184-4ca1-a23d-e2f61f9454e7</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>11c9f148-3420-4fab-a668-e9d81fb945f5</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:\Jiwa\Jiwa 7\Infragistics4.Win.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>64a36660-dc6f-4447-8eb1-35ba64c2c416</RecID>
      <AssemblyFullName>Microsoft.SqlServer.Smo, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.Smo.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\Microsoft.SqlServer.Smo.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>db93a219-33c5-4a52-8159-c6fad1769574</RecID>
      <AssemblyFullName>Microsoft.SqlServer.ConnectionInfo, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.ConnectionInfo.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\Microsoft.SqlServer.ConnectionInfo.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b701bdb3-2f71-44c0-9d74-9289d58c6d24</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5781fe5e-b065-4a3e-8554-5c6bba71bd41</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>0839d432-ee07-4449-a91e-ef28094ec2e5</RecID>
      <AssemblyFullName>FarPoint.Win.Spread, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.Spread.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\FarPoint.Win.Spread.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5054f570-8913-4241-9170-ad57bc3c2ed8</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a872b5f1-7aa6-48b4-836a-dc07f046d122</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:\Jiwa\Jiwa 7\Infragistics4.Shared.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9af82563-5ce8-46d2-b0b6-cc2e80c8cf84</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c7fdb901-dc61-4953-892f-7ae756624b8e</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>fef1fb4f-a0aa-440f-abf1-239076b7f362</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>f5a4e78a-6631-4c8e-be8a-b2322eb918e2</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinListView.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinListView.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinListView.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>4670a81b-c0be-433e-bf72-b7bbd7aeb085</RecID>
      <AssemblyFullName>ServiceStack, Version=5.0.0.0, Culture=neutral, PublicKeyToken=02c12cbda47e6587</AssemblyFullName>
      <AssemblyName>ServiceStack.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ServiceStack.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9bcf3140-cd09-431d-865f-723519e53419</RecID>
      <AssemblyFullName>EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>EntityFramework.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\EntityFramework.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>af136475-7035-40b8-a087-003742b2752c</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>cc26ae06-1dfe-4e3d-8a64-fae3d5eb1da1</RecID>
      <AssemblyFullName>ActiproSoftware.SyntaxEditor.WinForms, Version=16.1.330.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.SyntaxEditor.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ActiproSoftware.SyntaxEditor.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>6cec549a-4f19-4d0d-9e0f-2dcb5741cfc7</RecID>
      <AssemblyFullName>ZetaHtmlEditControl, Version=1.1.0.3, Culture=neutral, PublicKeyToken=2e2e5ba5da72b6c0</AssemblyFullName>
      <AssemblyName>ZetaHtmlEditControl.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ZetaHtmlEditControl.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>7b3c3e52-3f5a-47f5-b2ac-65b2e77fb124</RecID>
      <AssemblyFullName>ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms, Version=16.1.330.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>96ec33a5-5255-434a-991e-3934d40efef5</RecID>
      <AssemblyFullName>JiwaEncryption, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaEncryption.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaEncryption.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>62b91de1-4419-4034-abaf-161eef66618f</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:\Jiwa\Jiwa 7\Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>760ddfed-b00a-40d5-8830-c0d650961887</RecID>
      <AssemblyFullName>Microsoft.SqlServer.Dac, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.Dac.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\Microsoft.SqlServer.Dac.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>3e3cb570-6a91-456d-a4e9-6dcb958d8d60</RecID>
      <AssemblyFullName>CrystalDecisions.CrystalReports.Engine, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.CrystalReports.Engine.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\13.0.3500.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>0daa6d4f-116b-431f-a326-6c5b46c9f387</RecID>
      <AssemblyFullName>CrystalDecisions.Shared, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Shared.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\assembly\GAC_MSIL\CrystalDecisions.Shared\13.0.3500.0__692fbea5521e1304\CrystalDecisions.Shared.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>3665e918-d3dd-4642-abf2-9e08be58043f</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.Controllers, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.Controllers.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.Controllers\13.0.3500.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.Controllers.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d09a401b-3972-4741-8ca4-12727bdfcc6e</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:\Jiwa\Jiwa 7\Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>169f2dbf-12ed-4a39-bb96-66c58619ad75</RecID>
      <AssemblyFullName>JiwaLib, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaLib.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaLib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>971f8053-82bf-479c-b2ff-7a9168032485</RecID>
      <AssemblyFullName>Microsoft.ApplicationInsights, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.ApplicationInsights.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\Microsoft.ApplicationInsights.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c97c8bca-e0c0-4443-804c-70e967ba6860</RecID>
      <AssemblyFullName>CrystalDecisions.Windows.Forms, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\assembly\GAC_MSIL\CrystalDecisions.Windows.Forms\13.0.3500.0__692fbea5521e1304\CrystalDecisions.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>21dfadf5-0d96-4e54-a1df-eaccda18536a</RecID>
      <AssemblyFullName>EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>EntityFramework.SqlServer.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\EntityFramework.SqlServer.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>453d23cb-2a7b-4c75-b821-0d694162e9c2</RecID>
      <AssemblyFullName>ServiceStack.Text, Version=5.0.0.0, Culture=neutral, PublicKeyToken=02c12cbda47e6587</AssemblyFullName>
      <AssemblyName>ServiceStack.Text.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ServiceStack.Text.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9994e22c-cb8a-4a48-86f9-785eb8e60fef</RecID>
      <AssemblyFullName>ActiproSoftware.Shared.WinForms, Version=16.1.330.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.Shared.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ActiproSoftware.Shared.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>881996b2-be49-4f99-9f94-1bb9a554966c</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>0d148226-e98f-4d16-b9ab-32135c96bce4</RecID>
      <AssemblyFullName>FarPoint.Win, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\FarPoint.Win.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>946f4de7-96bc-4d61-824d-9f2a5f226b4b</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.ClientDoc.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc\13.0.3500.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.ClientDoc.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>08db3a70-b1f1-4bd5-a35d-de763487bf72</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.ReportDefModel, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.ReportDefModel.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ReportDefModel\13.0.3500.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.ReportDefModel.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>41701989-d53b-407d-a6ae-19cb637265b9</RecID>
      <AssemblyFullName>ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=02c12cbda47e6587</AssemblyFullName>
      <AssemblyName>ServiceStack.Interfaces.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ServiceStack.Interfaces.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>aeb8e9f6-6dce-4e0b-b6b9-8695ad2a89cd</RecID>
      <AssemblyFullName>ServiceStack.Server, Version = 5.0.0.0, Culture = neutral, PublicKeyToken = 02c12cbda47e6587</AssemblyFullName>
      <AssemblyName>ServiceStack.Server.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ServiceStack.Server.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>79819a31-26b6-4423-b609-aefd682f1554</RecID>
      <AssemblyFullName>ServiceStack.OrmLite, Version = 5.0.0.0, Culture = neutral, PublicKeyToken = 02c12cbda47e6587</AssemblyFullName>
      <AssemblyName>ServiceStack.OrmLite.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\ServiceStack.OrmLite.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9264bb61-ac5a-4336-a975-ec13b0f8e3b8</RecID>
      <AssemblyFullName>JiwaCreditorChqPay, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaCreditorChqPay.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaCreditorChqPay.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>dbcabf77-d2bc-417d-9133-6694302400b9</RecID>
      <AssemblyFullName>JiwaCreditorChqPayUI, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaCreditorChqPayUI.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaCreditorChqPayUI.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b1c23185-1738-4771-af6c-314ae40ce42d</RecID>
      <AssemblyFullName>JiwaBankDetailsUI, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaBankDetailsUI.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaBankDetailsUI.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>959c3e33-fc8d-4804-99fc-6158a881b576</RecID>
      <AssemblyFullName>JiwaBankDetails, Version=7.2.1.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaBankDetails.dll</AssemblyName>
      <AssemblyLocation>C:\Jiwa\Jiwa 7\JiwaBankDetails.dll</AssemblyLocation>
    </Reference>
  </ReferenceCollection>
</JiwaDocument>