<?xml version="1.0" encoding="utf-8"?><finPageSet version="1.00" exportedUtcDate="2021-07-27T21:49:31.0000000"><CreatedUserId>ADMIN</CreatedUserId><CreatedUtcDate>2021-07-27T21:46:18.6330000</CreatedUtcDate><UpdatedUserId>ADMIN</UpdatedUserId><UpdatedUtcDate>2021-07-27T21:48:36.1300000</UpdatedUtcDate><PageSetId>SMPL.AP</PageSetId><Active>true</Active><Beta>true</Beta><Code>Option Explicit On
Option Strict On

' #################################################################
' Sample Page Set to make an Account Payment.
'
' Version: 1.01 (28/07/2021)
'
' Usage: Sample Page Set.
' #################################################################

'#const "TransactionTypeId",String,"","Transaction Type Id for Payment."

' Constants
Private TransactionTypeId As String = "PAY"

' Objects
Private mAccountPayment As finAccountPayment

' Reporting and User Interface Objects
Public mReports As ISfinReports
Public mUI As ISUserInterfaceBL

Public Overrides Function Initialise() As Boolean

  ' Assume Success
  Initialise = True

  ' Initialise
  mReports = DirectCast(psh.Reports, ISfinReports)
  mUI = DirectCast(psh.UserInterface, ISUserInterfaceBL)

  ' Get Constants
  With ScriptInfo.Constants
    TransactionTypeId = .GetString("TransactionTypeId", TransactionTypeId)
  End With

  ' Create Objects
  mAccountPayment = finBL.CreateAccountPayment()

  ' Update Controls
  If Not finBL.SettingsUser.PerformanceAccountsAllowDbDropdownsResolved Then
    cboAccount.DataSourceStandardRangeFastMode = True
    cboAccount.PageObject.TextBoxWidth -= 32
  End If

  ' Reset Form
  Form_Reset()

End Function

Private Sub Form_Reset()

  ' Defaults
  cboAccount.Text = ""
  dateDate.Value = Now.Date
  numPayment.Value = 0

  ' Update Controls
  cboAccount_Change(Nothing, Nothing)

  ' Focus

  cboAccount.Focus()

End Sub

Private Sub Fields_Save()

  With mAccountPayment
    ' General
    .PaymentDate = dateDate.Value
    .PaymentValue = numPayment.Value
    .TransactionTypeId = TransactionTypeId
  End With

  ' Payment Details
  With pdaPaymentDetails.BankingDetails
    mAccountPayment.BankingDetails.PaymentMethodId = .PaymentMethodId
    mAccountPayment.BankingDetails.AccountName = .AccountName
    mAccountPayment.BankingDetails.AccountNumber = .AccountNumber
    mAccountPayment.BankingDetails.AccountSortCode = .AccountSortCode
    mAccountPayment.BankingDetails.BankBranchName = .BankBranchName
    mAccountPayment.BankingDetails.BankNameShort = .BankNameShort
    mAccountPayment.BankingDetails.CardExpiryDate = .CardExpiryDate
    mAccountPayment.BankingDetails.CardSecurityCode = .CardSecurityCode
    mAccountPayment.BankingDetails.Reference = .Reference
  End With

End Sub

Public Sub cboAccount_ButtonClick(sender As Object, e As finPageObjectButtonClickEventArgs) Handles cboAccount.ButtonClick

  Select Case e.ButtonId
    Case isefinPageObjectButtonType.RecordOpen.ToString()
      ' Open Account
      If Not finBL.ExecuteApplicationShortcutUrl("FormShow?form=Accounts&amp;id=" &amp; finBL.Runtime.HtmlUtilities.UrlEncode(cboAccount.Text)) Then
        mUI.ErrorMessageShow()
      End If
  End Select

End Sub

Public Sub cboAccount_Change(sender As Object, e As finPageObjectChangeEventArgs) Handles cboAccount.Change

  ' Handled
  If e IsNot Nothing Then e.ChangeHandled = True

  ' Load Account Payment
  If Len(cboAccount.Text) = 0 Then
    mAccountPayment.Clear()
  Else
    If Not mAccountPayment.AccountLoad(cboAccount.Text) Then
      cboAccount.Text = ""
      mUI.ErrorMessageShow()
    End If
  End If

  ' Upate Payment Details
  pdaPaymentDetails.BankingDetails = mAccountPayment.Account.BankingDetails(isefinAccountBankingDetailsType.Incoming).BankingDetails.Clone()

  ' Update Preview
  htmlAccountSummary_Preview()

End Sub

Private Sub htmlAccountSummary_Preview()

  ' Save Fields
  Fields_Save()

  ' Use Built-In Account Payment Summary Page
  If Len(cboAccount.Text) = 0 Then
    htmlAccountSummary.Text = ""
  Else
    htmlAccountSummary.Text = finBL.ScriptFunctions.BuiltInAccountPaymentSummaryScript(mAccountPayment)
  End If

End Sub

Public Sub Details_Change(sender As Object, e As finPageObjectChangeEventArgs) Handles dateDate.Change, numPayment.Change, pdaPaymentDetails.Change

  ' Handled
  If e IsNot Nothing Then e.ChangeHandled = True

  ' Update Preview
  htmlAccountSummary_Preview()

End Sub

Public Sub PageSet_CommandButtonClick(sender As Object, e As finPageSetHandlerCommandButtonClickEventArgs) Handles Me.CommandButtonClick

  Dim Ok As Boolean
  Dim strTemp As String

  Select Case e.CommandButton
    Case isefinPageSetCommandButton.Finish
      ' Do not close wizard
      e.Cancel = True

      ' Save Fields
      Fields_Save()

      ' Confirm
      strTemp = String.Format("Make a Payment of {0} to Account '{1}', dated {2}.", finBL.FormatCurrency(mAccountPayment.PaymentValueResolved, True), mAccountPayment.Account.AccountId, finBL.FormatDateLong(mAccountPayment.PaymentDate))
      If mAccountPayment.PaymentValue &lt;&gt; mAccountPayment.PaymentValueResolved Then
        strTemp &amp;= vbNewLine &amp; vbNewLine &amp; String.Format("WARNING: View the Account Summary for details of why this payment does not match the value of {0} that you have specified.", finBL.FormatCurrency(mAccountPayment.PaymentValue, True))
      End If
      Select Case mUI.MsgBox(strTemp, MsgBoxStyle.Question Or MsgBoxStyle.YesNo)
        Case MsgBoxResult.Yes
        Case Else: Exit Sub
      End Select

      ' Make Payment
      Ok = mAccountPayment.ExecuteCommit()

      If Ok Then
        ' Notify
        mUI.MsgBox(String.Format("A Payment of {0} has been made to Account '{1}'.", finBL.FormatCurrency(mAccountPayment.PaymentValueResolved, True), mAccountPayment.Account.AccountId), MsgBoxStyle.Information)

        ' Reset wizard
        Form_Reset()
      Else
        ' Error
        mUI.ErrorMessageShow()
      End If
  End Select

End Sub

Public Sub PageSet_WizardValidate(sender As Object, e As finPageSetHandlerWizardValidateEventArgs) Handles Me.WizardValidate

  Select Case e.PageId
    Case "PAYMENT"
      If dateDate.Value &gt; Now.Date Then
        e.Failed = True
        dateDate.Focus()
        mUI.MsgBox("Payments cannot be future-dated.", MsgBoxStyle.Exclamation)
      End If
  End Select

End Sub</Code><CommandButtonCancelCaption /><CommandButtonOkCaption /><CommandButtonPrintCaption /><CommandButtonSaveCaption /><CommandButtonsShowCancel>true</CommandButtonsShowCancel><CommandButtonsShowOk>true</CommandButtonsShowOk><CommandButtonsShowPrint>false</CommandButtonsShowPrint><CommandButtonsShowSave>false</CommandButtonsShowSave><Description>Custom Account Payment Wizard</Description><FormMinimumHeight>600</FormMinimumHeight><FormMinimumWidth>540</FormMinimumWidth><FormShowHeading>true</FormShowHeading><Icon /><Language>VisualBasic</Language><NavigationMethod>Wizard</NavigationMethod><Notes>Sample Custom Account Payment Page Set.

Detailed in the finPOWER Connect 2 Page Sets document.</Notes><PermissionKeyExecute /><Pages><finPageSetPages version="1.00"><PageSetPage version="1.00"><Active>true</Active><Code>PAYMENT</Code><LayoutMode>Flow</LayoutMode><Summary>Select an Account and enter Payment details.</Summary><Title>Select Account</Title><PageObjects><finPageObjects version="1.00"><PageObject name="lblAccount"><AutoSize>true</AutoSize><Caption>Select the Account making Payment.</Caption><CaptionWidth>-1</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>16</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>4</PaddingBottom><PaddingLeft>0</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>0</PaddingTop><PageObjectType>Label</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>200</Width><FontBold>false</FontBold><FontItalic>false</FontItalic><FontName /><FontSize>8.5</FontSize><FontUnderline>false</FontUnderline><HeightFill>false</HeightFill><LabelStyle>Heading4</LabelStyle></PageObject><PageObject name="cboAccount"><AutoSize>true</AutoSize><Caption>Account:</Caption><CaptionWidth>80</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>20</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>4</PaddingBottom><PaddingLeft>8</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>0</PaddingTop><PageObjectType>DbComboBox</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>132</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>0</Width><FontBold>false</FontBold><Mandatory>false</Mandatory><MaxLength>10</MaxLength><DataSourceType>StandardRange</DataSourceType><DataSourceSqlWhere>Account.Status=1</DataSourceSqlWhere><DataSourceStandardRange>Accounts</DataSourceStandardRange><DataSourceStandardRangeFastMode>false</DataSourceStandardRangeFastMode><DataSourceStandardRangeIncludeActiveOnly>false</DataSourceStandardRangeIncludeActiveOnly><DataSourceStandardRangeShowFindButton>true</DataSourceStandardRangeShowFindButton><Mandatory>false</Mandatory><ButtonType1>RecordOpen</ButtonType1><ButtonType2>None</ButtonType2><ButtonType3>None</ButtonType3></PageObject><PageObject name="lblPayment"><AutoSize>true</AutoSize><Caption>Enter Payment details.</Caption><CaptionWidth>-1</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>16</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>4</PaddingBottom><PaddingLeft>0</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>8</PaddingTop><PageObjectType>Label</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>200</Width><FontBold>false</FontBold><FontItalic>false</FontItalic><FontName /><FontSize>8.5</FontSize><FontUnderline>false</FontUnderline><HeightFill>false</HeightFill><LabelStyle>Heading4</LabelStyle></PageObject><PageObject name="dateDate"><AutoSize>true</AutoSize><Caption>Date:</Caption><CaptionWidth>80</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>20</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>4</PaddingBottom><PaddingLeft>8</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>0</PaddingTop><PageObjectType>DateBox</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>0</Width><DateSpecialType>None</DateSpecialType><FontBold>false</FontBold><Mandatory>true</Mandatory><MaxValue /><MinValue /><ShowSpin>true</ShowSpin><ButtonType1>None</ButtonType1><ButtonType2>None</ButtonType2><ButtonType3>None</ButtonType3></PageObject><PageObject name="numPayment"><AutoSize>true</AutoSize><Caption>Payment:</Caption><CaptionWidth>80</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>20</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>4</PaddingBottom><PaddingLeft>8</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>0</PaddingTop><PageObjectType>NumberBox</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>0</Width><FontBold>false</FontBold><Mandatory>false</Mandatory><MaxValue>10000</MaxValue><MinValue>0.01</MinValue><NumberBoxAllowBlank>false</NumberBoxAllowBlank><NumberBoxBlankIfZero>false</NumberBoxBlankIfZero><NumberBoxDecimals>0</NumberBoxDecimals><NumberBoxGroupDigits>true</NumberBoxGroupDigits><NumberBoxSpecialType>Currency</NumberBoxSpecialType><ShowSpin>true</ShowSpin><ButtonType1>None</ButtonType1><ButtonType2>None</ButtonType2><ButtonType3>None</ButtonType3></PageObject><PageObject name="pdaPaymentDetails"><AutoSize>true</AutoSize><Caption /><CaptionWidth>-1</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>20</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>4</PaddingBottom><PaddingLeft>0</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>0</PaddingTop><PageObjectType>AccountPaymentDetails</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>500</Width><Mandatory>false</Mandatory></PageObject><PageObject name="lblAccountSummary"><AutoSize>true</AutoSize><Caption>Account Summary.</Caption><CaptionWidth>-1</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>16</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>0</PaddingBottom><PaddingLeft>0</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>8</PaddingTop><PageObjectType>Label</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>200</Width><FontBold>false</FontBold><FontItalic>false</FontItalic><FontName /><FontSize>8.5</FontSize><FontUnderline>false</FontUnderline><HeightFill>false</HeightFill><LabelStyle>Heading4</LabelStyle></PageObject><PageObject name="htmlAccountSummary"><AutoSize>true</AutoSize><Caption /><CaptionWidth>-1</CaptionWidth><ColourBackground /><ColourForeground /><Enabled>true</Enabled><FieldHint /><GroupTags /><Height>80</Height><KeepWithPrevious>false</KeepWithPrevious><Left>0</Left><LeftAlignPageObjectName /><PaddingBottom>0</PaddingBottom><PaddingLeft>8</PaddingLeft><PaddingRight>0</PaddingRight><PaddingTop>0</PaddingTop><PageObjectType>HtmlPanel</PageObjectType><ReadOnly>false</ReadOnly><TabIndex>0</TabIndex><TabStop>true</TabStop><TextBoxWidth>0</TextBoxWidth><TooltipText /><Top>0</Top><Visible>true</Visible><Width>0</Width><HeightFill>true</HeightFill><HtmlPanelDisabledCaption /><HtmlPanelShowBorder>true</HtmlPanelShowBorder></PageObject></finPageObjects></PageObjects></PageSetPage></finPageSetPages></Pages></finPageSet>