Article Details
Id:13456
Product:finPOWER Connect
Type:NEW
Version:2.03.04
Opened:26/11/2015
Closed:27/11/2015
Released:03/02/2016
Job: J016619

Account Applications; Banking Details can now be recorded

The finAccountApp has a BankingDetails collection (fixed with 3 items). This property previously did nothing.

In addition to this, the following changes have been made:

  • A new "Payment Types" Standard Range so that Page Sets can present a list of the built-in Payment Types if required.

NOTE: When creating an Account from an Account Application, the Account's BankingDetails collection will only be automatically populated if the following conditions are met:

  • The Account Application's Banking Method contains valid details and matches the collection type on the Account (e.g., the Account defines "Incoming" Banking Details).
  • The Account Application's Banking Details specify a valid Payment Method.

If the above are not fulfilled, it is up to the Account Application Script to determine (probably based on the Payment Type), what Banking Details to add and to populate the relevant properties.

Sample Page Set code to load and save these properties is shown below:

Private Sub Fields_Load()

  ' Application
  With mAccountApp
    With .BankingDetails(isefinAccountBankingDetailsType.Incoming)
      cboPaymentType.Text = .PaymentTypeId
      txtBankAccountName.Text = .AccountName
      txtBankAccountNumber.Text = .AccountNumber
    End With
  End With

End Sub

Private Sub Fields_Save()

  ' Application
  With mAccountApp
    With .BankingDetails(isefinAccountBankingDetailsType.Incoming)
      .PaymentTypeId = cboPaymentType.Text
      .AccountName = txtBankAccountName.Text
      .AccountNumber = txtBankAccountNumber.Text
    End With
  End With

End Sub

And an example of Account Application Type Script to populate the Account's Banking Details based on the Payment Type is shown below:

Public Overrides Function UpdateAccount(accountApp As finAccountApp, account As finAccount) As Boolean

  Dim BankingDetails As finBankingDetails
  Dim strTemp As String

  ' Call Base Method to update the Account
  UpdateAccount = MyBase.UpdateAccount(accountApp, account)

  ' Banking Details
  If account.BankingDetails.ExistsBankingDetailsType(isefinAccountBankingDetailsType.Incoming) Then
    ' Get Account Application Banking Details (Incoming will always exist for Account Applications)
    BankingDetails = accountApp.BankingDetails(isefinAccountBankingDetailsType.Incoming)

    ' Update Account
    With account.BankingDetails(isefinAccountBankingDetailsType.Incoming)
      If BankingDetails.HasValue Then
        If .PaymentMethodPk = 0 Then
          ' Add based on Payment Type (assumes certain Payment Methods exist and does not vary based on Branch/ Entity)
          Select Case UCase(BankingDetails.PaymentTypeId)
            Case "VISA"
              ' Visa
              .PaymentMethodId = "VISA"
              .AccountName = BankingDetails.AccountName
              .AccountNumber = BankingDetails.AccountNumber

              ' Clear if values are not valid (so Account can be saved)
              If Not .IsBankingDetailsValid() Then
                strTemp = "Could not add 'VISA' payment method to Account since Banking Details are not valid." & vbNewLine & vbNewLine & finBL.Error.Message()
                finBL.Trace.WriteWarning(strTemp)
                account.Notes = strTemp
                .Clear()
              End If

            Case Else
              ' Not handled
          End Select
        Else
          ' Probably already created automatically since a Payment Method has been specified
        End If
      End If
    End With
  End If

End Function