#Description: Example Function to add an Interest Adjustment to an Account.
#Author: Intersoft Systems Limited
#Version: 1.00
#Last Updated: 20/04/2020

''' <summary>
'''  Adds an Interest Adjustment for an Account.
''' </summary>
''' <param name="accountPk">
'''  The Primary Key of the Account. If you already have the Account object loaded, set to Account.Pk.
''' </param>
''' <param name="adjustmentDate">
'''  The date to make the Interest Adjustment.
''' </param>
''' <param name="reference">
'''  Your Reference for the Interest Adjustment. Maximum of 20 characters.
''' </param>
''' <param name="notes">
'''  Any Notes regarding the Interest Adjustment. Maximum of 255 characters.
''' </param>
''' <param name="value">
'''  The value of the Interest Adjustment.
''' </param>
''' <returns>
'''  A Boolean value indicating success.
''' </returns>
Private Function Account_InterestAdjustment(accountPk As Integer,
                                            adjustmentDate As Date,
                                            reference As String,
                                            notes As String,
                                            value As Decimal) As Boolean

  Dim AccountInterestAdjustment As finAccountInterestAdjustment
  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Create Objects
  AccountInterestAdjustment = finBL.CreateAccountInterestAdjustment()
	
  With AccountInterestAdjustment
    ' Load Account
    Success = .AccountLoadPk(accountPk)

    If Success Then
      ' Update Properties
      .AdjustInterest = True
      .DateAdjustment = adjustmentDate
      .Notes = notes
      .Reference = reference
      .Value = value

      ' Commit 
      Success = .ExecuteCommit()
    End If
  End With

  ' Return Success
  Return Success

End Function