| Table: Ledger_Entry | |||
| Columns | |||
| Name | Type | Constraints | Description |
| ledger_entry_KEY | int | NOT NULL | Assigned by COMMON_dp_Allocate_Unique_Identifiers. Database assigned primary key for this table |
| row_version | timestamp | NOT NULL | |
| update__staff_KEY | int | NOT NULL | |
| update_date_utc | datetime | NOT NULL | |
| bank_account_KEY | int | A bank account is required for all types except Invoices and Service Charges which must not specify a bank account. | |
| control_date | smalldatetime | NOT NULL | Date used to group Ledger Entries together. |
| ledger_entry_type_KEY | int | NOT NULL | The type of this Ledger Entry. |
| client_KEY | int | NOT NULL | Key to a Client row |
| entry_date | smalldatetime | NOT NULL | Date of this item (check date, invoice date, receipt date). |
| reference | nvarchar (30) | NOT NULL | User defined reference for this entry. |
| amount | decimal (17, 2) | NOT NULL | The total amount of this item. |
| comments | nvarchar (-1) | NOT NULL | Comments about this item that can be included on reports. |
| internal_comments | nvarchar (-1) | NOT NULL | Comments about this item that are internal to the firm. |
| approved_date | smalldatetime | Date this item was approved. | |
| approved__staff_KEY | int | Key of the Staff who approved this item. | |
| posted_date | smalldatetime | Date this item was posted. | |
| posted__staff_KEY | int | Key of the Staff who posted this item. | |
| entry_number | int | NOT NULL | Each entry will be assigned a number that is unique by Ledger Entry Type that the user can select. |
| create_date_utc | datetime | NOT NULL | |
| ledger_entry_subtype_KEY | int | NOT NULL | The subtype of this Ledger Entry. |
| digita_vat_period_KEY | int | The key for the closed digita VAT period. | |
| digita_tax_point_date_override | datetime | Allows entry_date to be overridden as the tax point. | |
| digita_proforma__ledger_entry_KEY | int | The new key for the digita proforma ledger entry related to this ledger entry. | |
| Primary key | |||
| Name | Columns | Description | |
| PK_Ledger_Entry$ledger_entry_KEY | ledger_entry_KEY | CLUSTERED | |
| Unique constraints | |||
| Name | Columns | Description | |
| UK_Ledger_Entry$ledger_entry_subtype_KEY$entry_number | ledger_entry_subtype_KEY, entry_number | ||
| Indexes | |||
| Name | Columns | Description | |
| IX_Ledger_Entry$approved__staff_KEY$approved_date | approved__staff_KEY, approved_date | ||
| IX_Ledger_Entry$bank_account_KEY | bank_account_KEY | ||
| IX_Ledger_Entry$client_KEY$entry_date | client_KEY, entry_date | ||
| IX_Ledger_Entry$control_date@ledger_entry_type_KEY | control_date, ledger_entry_type_KEY | ||
| IX_Ledger_Entry$entry_date@posted__staff_KEY | entry_date, posted__staff_KEY | ||
| IX_Ledger_Entry$entry_number | entry_number | ||
| IX_Ledger_Entry$ledger_entry_KEY$entry_date$posted__staff_KEY$amount$client_KEY | ledger_entry_KEY, entry_date, posted__staff_KEY, amount, client_KEY | ||
| IX_Ledger_Entry$ledger_entry_KEY$entry_date$posted_date | ledger_entry_KEY, entry_date, posted_date | ||
| IX_Ledger_Entry$ledger_entry_type_KEY$client_KEY$entry_date | ledger_entry_type_KEY, client_KEY, entry_date | Speeds up retrieving last service charge date by client_KEY enough to not have to cache it on Client record. | |
| IX_Ledger_Entry$posted__staff_KEY$posted_date | posted__staff_KEY, posted_date | ||
| IX_Ledger_Entry$reference | reference | ||