CreditsAndRefundsOptions Class

Options class to set parameter values for CreditsAndRefunds Accoutning Seed API methods.

CreditsAndRefundsOptions global variables

The following are global variables of the CreditsAndRefundsOptions class.

sourceRecordId

The Id of the sObject record for which a refund or credit is to be created

Type: Id
Required: True

refundAmount

Amount of the refund.

Type: Decimal
Required: False
Default: Balance__c value from the source record.

refundDate

The date the refund is issued. Used to set the Date__c value of source records created during the credit/return process

Type: Date
Required: False
Default: Current Date

paymentType

Expected values 'Check' or 'Electronic'.

Type: String
Required: False
Default: If source record is a cash receipt it will default to the payment type from that record

bankAccount

The ID to the Bank General Ledger Account (GL_Account__c).

Type: Id
Required: False
Default: If source record is a cash receipt it will default to the bank GL Account from that record

reference

String value to note the reference the source record being refunded

Type: String
Required: False
Default: '{Cash Receipt Name} refund' or '{Credit Memo Name} refund' depending on the source record type

memo

String value to store an optional memo

Type: String
Required: False

project

The ID to the Project (Project__c)

Type: Id
Required: False
Default: Project__c from source Cash_Receipt__c

projectTask

The ID to the Project Task (Project_Task__c)

Type: Id
Required: False
Default: Project_Task__c from source Cash_Receipt__c

gla1

The ID to the General Ledger Account Variable 1 (GL_Account_Variable_1__c)

Type: Id
Required: False
Default: GL_Account_Variable_1__c from source Cash_Receipt__c

gla2

The ID to the General Ledger Account Variable 2 (GL_Account_Variable_2__c)

Type: Id
Required: False
Default: GL_Account_Variable_2__c from source Cash_Receipt__c

gla3

The ID to the General Ledger Account Variable 3 (GL_Account_Variable_3__c)

Type: Id
Required: False
Default: GL_Account_Variable_3__c from source Cash_Receipt__c

gla4

The ID to the General Ledger Account Variable 4 (GL_Account_Variable_4__c)

Type: Id
Required: False
Default: GL_Account_Variable_4__c from source Cash_Receipt__c

CreditsAndRefundsOptions global methods

The following is the global constructor of the CreditsAndRefundsOptions class.

CreditsAndRefundsOptions(Id)

Signature

global CreditsAndRefundsOptions(Id sourceRecordId)

Parameters
Type: [Id]
Value: The id of the Credit Memo (Billing__c) or Cash Receipt (Cash_Receipt__c) to be refunded
** Constructing this class will set the defualt values listed for each variable based on the source record sObject type (Billing or Cash Receipt) supplied in the parameters.

Usage

Id sourceRecordId;
CreditsAndRefundsOptions options = new CreditsAndRefundsOptions(sourceRecordId);