Line Items

Line Items constitute the second part of the double entry after transactions establish the first part. A transaction can have multiple line items each with a different account, vat and amount.

Attributes

  • entity: The Entity object associated with the line item. Defaults to the entity of the logged in user.
  • vat: The Vat object associated with the line item.
  • transaction: The Transaction object associated with the line item.
  • account: The Account associated with the line item.
  • narration: A short discription of the purpose of the line item.
  • quantity: A multiple to be applied to the amount of the line item.
  • credited: A boolean indicating whether the line item amount should be posted in the credit side of the account. Only relevant for compound Journal Entries, all other transactions post to the opposite side of the transaction’s main account.
  • amount: The line item amount.
  • ledgers: Ledger objects associated with the line item.
  • vat_inclusive: A boolean indicating if the amount of the item includes the vat amount.

Methods

  • $lineItem->attributes(): Presents the line item’s attributes as an object. Useful for debugging.
  • $lineItem->toString(): The string representation of the LineItem object instance.

Constraints

  • NegativeAmount: Line item amounts cannot be negative.
  • PostedTransaction: Line items cannot be added or removed from a posted transaction.