Table: Ledger_Entry
Columns
NameTypeConstraintsDescription
ledger_entry_KEYintNOT NULLAssigned by COMMON_dp_Allocate_Unique_Identifiers. Database assigned primary key for this table
row_versiontimestampNOT NULL
update__staff_KEYintNOT NULL
update_date_utcdatetimeNOT NULL
bank_account_KEYintA bank account is required for all types except Invoices and Service Charges which must not specify a bank account.
control_datesmalldatetimeNOT NULLDate used to group Ledger Entries together.
ledger_entry_type_KEYintNOT NULLThe type of this Ledger Entry.
client_KEYintNOT NULLKey to a Client row
entry_datesmalldatetimeNOT NULLDate of this item (check date, invoice date, receipt date).
referencenvarchar (30)NOT NULLUser defined reference for this entry.
amountdecimal (17, 2)NOT NULLThe total amount of this item.
commentsnvarchar (-1)NOT NULLComments about this item that can be included on reports.
internal_commentsnvarchar (-1)NOT NULLComments about this item that are internal to the firm.
approved_datesmalldatetimeDate this item was approved.
approved__staff_KEYintKey of the Staff who approved this item.
posted_datesmalldatetimeDate this item was posted.
posted__staff_KEYintKey of the Staff who posted this item.
entry_numberintNOT NULLEach entry will be assigned a number that is unique by Ledger Entry Type that the user can select.
create_date_utcdatetimeNOT NULL
ledger_entry_subtype_KEYintNOT NULLThe subtype of this Ledger Entry.
digita_vat_period_KEYintThe key for the closed digita VAT period.
digita_tax_point_date_overridedatetimeAllows entry_date to be overridden as the tax point.
digita_proforma__ledger_entry_KEYintThe new key for the digita proforma ledger entry related to this ledger entry.
Primary key
NameColumnsDescription
PK_Ledger_Entry$ledger_entry_KEYledger_entry_KEYCLUSTERED
Unique constraints
NameColumnsDescription
UK_Ledger_Entry$ledger_entry_subtype_KEY$entry_numberledger_entry_subtype_KEY, entry_number
Indexes
NameColumnsDescription
IX_Ledger_Entry$approved__staff_KEY$approved_dateapproved__staff_KEY, approved_date
IX_Ledger_Entry$bank_account_KEYbank_account_KEY
IX_Ledger_Entry$client_KEY$entry_dateclient_KEY, entry_date
IX_Ledger_Entry$control_date@ledger_entry_type_KEYcontrol_date, ledger_entry_type_KEY
IX_Ledger_Entry$entry_date@posted__staff_KEYentry_date, posted__staff_KEY
IX_Ledger_Entry$entry_numberentry_number
IX_Ledger_Entry$ledger_entry_KEY$entry_date$posted__staff_KEY$amount$client_KEYledger_entry_KEY, entry_date, posted__staff_KEY, amount, client_KEY
IX_Ledger_Entry$ledger_entry_KEY$entry_date$posted_dateledger_entry_KEY, entry_date, posted_date
IX_Ledger_Entry$ledger_entry_type_KEY$client_KEY$entry_dateledger_entry_type_KEY, client_KEY, entry_dateSpeeds 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_dateposted__staff_KEY, posted_date
IX_Ledger_Entry$referencereference
Foreign keys
NameColumnsReferenced tableDescription
FK_Ledger_Entry__Bank_Account__bank_account_KEYbank_account_KEYBank_Account
FK_Ledger_Entry__Client__client_KEYclient_KEYClient
FK_Ledger_Entry__Digita_Vat_Period__digita_vat_period_KEYdigita_vat_period_KEYDigita_Vat_Period
FK_Ledger_Entry__Ledger_Entry_Subtype__ledger_entry_subtype_KEYledger_entry_subtype_KEYLedger_Entry_Subtype
FK_Ledger_Entry__Ledger_Entry_Type__ledger_entry_type_KEYledger_entry_type_KEYLedger_Entry_Type
FK_Ledger_Entry__Staff__approved__staff_KEYapproved__staff_KEYStaff
FK_Ledger_Entry__Staff__posted__staff_KEYposted__staff_KEYStaff
Incoming foreign keys
NameColumnsReferencing tableDescription
FK_Invoice__Ledger_Entry__invoice_KEYinvoice_KEYInvoice
FK_Invoice__Ledger_Entry__ledger_entry_KEYledger_entry_KEYInvoice
FK_Ledger_Entry_Application__Ledger_Entry__from__ledger_entry_KEYfrom__ledger_entry_KEYLedger_Entry_Application
FK_Ledger_Entry_Application__Ledger_Entry__to__ledger_entry_KEYto__ledger_entry_KEYLedger_Entry_Application
FK_Ledger_Entry_Service_Charge__Ledger_Entry__past_due__ledger_entry_KEYpast_due__ledger_entry_KEYLedger_Entry_Service_Charge
FK_Ledger_Entry_Service_Charge__Ledger_Entry__service_charge__ledger_entry_KEYservice_charge__ledger_entry_KEYLedger_Entry_Service_Charge
FK_Ledger_Entry_Submittal__Ledger_Entry__ledger_entry_KEYledger_entry_KEYLedger_Entry_Submittalon delete cascade;
FK_Online_Payment__Ledger_Entry__ledger_entry_KEYledger_entry_KEYOnline_Paymenton delete cascade;
FK_Billing_Decision_Collection__Ledger_Entry__collection_source__ledger_entry_KEYcollection_source__ledger_entry_KEYBilling_Decision_Collectionon delete cascade;
FK_Billing_Decision_Tax_Collection__Ledger_Entry__collection_source__ledger_entry_KEYcollection_source__ledger_entry_KEYBilling_Decision_Tax_Collectionon delete cascade;

Schema diagram