Skip to content
Hugh Jeremy edited this page Aug 17, 2018 · 2 revisions

Documentation > Entry

Entries compose Transactions. An individual Entry allocates some value to an Account as either one of the fundamental Sides: a debit or a credit. All together, those debits and credits will add up to zero, satisfying the fundamental double-entry accounting equality.

When utilising the Amatino API, operations involving Entries always occur as part of a Transaction request. For example, when creating a Transaction, you will specify a JSON Array of Entry objects under the entries key. You will never send or recieve an Entry object on its own to or from the Amatino API.

Properties

.side - Side

The fundamental side of this Entry, a debit or a credit.

Example: Side.debit


.description - String

A friendly description of this Entry. Suitable for a more granular description than that provided to the containing Transaction. You might also provide an empty string if the containing Transaction's description already provides sufficient information.

Example: "Portion of transaction allocating prior customer deposit to revenue"


.accountId - Number

The integer identifier of the Account to which this Entry allocates value.

Example: 42


.amount - String

A string describing the amount of value this Entry allocates.

Example: "100.42"

Constructor

You will use the constructor to initialise Entries for inclusion in Transactions. For example, see the constructor in action in the Transaction.createWithGlobalUnit() static method.

Parameters

  1. side: Side
  2. description: String
  3. account: Account
  4. amount: String

Example

const debitEntry = new Entry(
  Side.debit,
  "Increase value of cash on hand",
  cashOnHand, // an instance of type Account,
  amount: "42.42"
)

Documentation

Introduction

Primary

Ancillary

Clone this wiki locally