Adjustments

Adjustment notes are a formal way of making a change to a sale / invoice. They can take
the form of a credit note when giving balance back to the customer.

Class Methods

The following methods can be invoked on instances of this class.

getCount(array arrFilter)

Returns the number of adjustments

getAll(array arrProperties)

Returns all adjustments, filterable by $arrProperties

getAvailableAdjustmentsForContact(int iContact)

Retrieve all adjustments which might be usable by a contact during a sale

getAvailableAdjustmentsForContactFilter(int iContact)

Creates the filter required by getAvailableAdjustmentsForContact()

getTotal(array arrFilter)

Returns the total value of credit notes

getTotalUsed(array arrFilter)

Returns the total value of used credit notes

getTotalRemaining(array arrFilter)

Returns the total value of remaining credit

getTotalRemainingForContact(int iContactId)

Retrieves the total remaining credit for specific contact

getTotalRemainingCoversAmount(mixed fAmount, array arrFilter)

Determines if the total of adjustments remaining covers a specific amount

getTotalRemainingForContactCoversAmount(mixed fAmount, int iContactId)

Determines if the total of adjustment credit remaining covers a specific amount for a specific contact

renderAdmin(mixed arrAdjustment, string strTarget)

Renders an adjustment in the admin

renderStatus(array arrAdjustment)

Renders the status of an adjustment

reasonsGetAll(mixed arrProperties)

Returns a list of reason classes

reasonsGet(mixed strReason)

Returns reflection information from a reason class id

componentIsInstalled()

Determines if a specific component is installed

componentGetEntityType(mixed arrEntity)

Returns the type of entity handled by the component

componentGetEntityIcon()

Retrieves the default icon path for the component entities

install()

Installs the component

uninstall()

Uninstalls the component

eventGetHandlers()

Returns a set of event handlers for this component

eventTrigger(mixed strEvent, array arrEventParams)

Triggers a component event

securityOperationsGetAll()

Returns a set of security operations for this component

configGetAll(array arrProperties)

Retrieves all config items for the component

configGetAllValues(array arrProperties)

Retrieves all config items for the component in a item_id => item_value fashion

configGetValue(string strConfigId)

Retrieves the value of a config item for the current component

configSaveValue(mixed strConfigId, mixed strValue, string strReason)

Saves the value of a config item for the current component

uiGetActions(mixed bInList, bool bInEdit)

Returns an array of user interface actions for the component

__call(mixed strName, array arrArguments)

Magic function to trap calls to undefined functions and throw an exception rather than
a fatal error.

__callStatic(mixed strName, array arrArguments)

Magic function to trap static calls to undefined functions and throw an exception rather
than a fatal error.

classGetFolder()

Returns the folder where the class exists

__set_state(mixed arrValues)

classGetFolderResources()

Returns the folder where the class's resources exist

classGetSrcFile()

Returns the folder where the class exists

classGetSrcHash()

Returns the folder where the class exists

classGetReflection()

Returns the reflection data for the current class

classGetReflectionAnnotation(string strField)

Returns a specific class annotation for the current class



Reasons

Bad Debt
Used when adjusting the balance out of a sale due to bad debt.

Correction
Used when making a change to the items on a sale.

Credit
Used when giving a generic credit note.

Discount
Used when giving a credit which is discounting the original sale.