Table: Invoice
Columns
NameTypeConstraintsDescription
ledger_entry_KEYintNOT NULL
invoice_KEYintNOT NULLDatabase assigned primary key for this table
update__staff_KEYintNOT NULL
update_date_utcdatetimeNOT NULL
create_date_utcdatetimeNOT NULL
row_versiontimestampNOT NULL
report_definition_KEYintNOT NULLKey to an Invoice Report Definition record.
printedbitNOT NULLIndicates if this Invoice has been printed.
due_datesmalldatetimeNOT NULLDue date
billed_datesmalldatetimeNOT NULLDate this invoice was saved.
billed__staff_KEYintNOT NULLKey of the Staff who billed this invoice.
invoice_formatnvarchar (-1)NOT NULLThe uncompressed invoice format containing a copy of the invoice Report Definition and composed field values.
time_amount_billeddecimal (17, 2)NOT NULLDenormalized
time_amount_adjusteddecimal (17, 2)NOT NULLDenormalized
expense_amount_billeddecimal (17, 2)NOT NULLDenormalized
expense_amount_adjusteddecimal (17, 2)NOT NULLDenormalized
progress_amount_billeddecimal (17, 2)NOT NULLDenormalized
surchargedecimal (17, 2)NOT NULLDenormalized
discountdecimal (17, 2)NOT NULLThe discount amount on this invoice (always 0 or negative.)
sales_taxdecimal (17, 2)NOT NULLDenormalized
service_taxdecimal (17, 2)NOT NULLDenormalized
positive_invoiceddecimal (17, 2)NOT NULLSum of Billing_Decision.invoiced for this invoice where Billing_Decision.invoiced > 0.
negative_invoiceddecimal (17, 2)NOT NULLSum of Billing_Decision.invoiced for this invoice where Billing_Decision.invoiced < 0.
positive_nonprogress_invoiceddecimal (17, 2)NOT NULLSum of Billing_Decision.invoiced for this invoice where Billing_Decision.invoiced > 0 and the Billing_Decision is not progress or progress relief.
negative_nonprogress_invoiceddecimal (17, 2)NOT NULLSum of Billing_Decision.invoiced for this invoice where Billing_Decision.invoiced < 0 and the Billing_Decision is not progress or progress relief.
positive_progress_invoiceddecimal (17, 2)NOT NULLSum of Billing_Decision.invoiced for this invoice where Billing_Decision.invoiced > 0 and the Billing_Decision is progress or progress relief.
negative_progress_invoiceddecimal (17, 2)NOT NULLSum of Billing_Decision.invoiced for this invoice where Billing_Decision.invoiced < 0 and the Billing_Decision is progress or progress relief.
invoice_format_compressedvarbinary (-1)The compressed invoice format containing a copy of the invoice Report Definition and composed field values.
invoice_format_storage_style_KEYintNOT NULLKey of the Invoice Format Storage Style that indicates how the invoice format is stored.
Primary key
NameColumnsDescription
PK_Invoice$ledger_entry_KEYledger_entry_KEYCLUSTERED
Unique constraints
NameColumnsDescription
UK_Invoice$invoice_KEYinvoice_KEYDEPRECATED. With a new primary key, the invoice table must have a unique constraint to replace it.
Indexes
NameColumnsDescription
IX_Invoice$billed__staff_KEYbilled__staff_KEYIndex supports foreign key FK_Invoice__Staff__billed__staff_KEY
IX_Invoice$invoice_format_storage_style_KEYinvoice_format_storage_style_KEYIndex supports foreign key FK_Invoice__Invoice_Format_Storage_Style__invoice_format_storage_style_KEY
IX_Invoice$report_definition_KEYreport_definition_KEYIndex supports foreign key FK_Invoice__Report_Definition__report_definition_KEY
Foreign keys
NameColumnsReferenced tableDescription
FK_Invoice__Ledger_Entry__invoice_KEYinvoice_KEYLedger_Entry
FK_Invoice__Ledger_Entry__ledger_entry_KEYledger_entry_KEYLedger_Entry
FK_Invoice__Report_Definition__report_definition_KEYreport_definition_KEYReport_Definition
FK_Invoice__Staff__billed__staff_KEYbilled__staff_KEYStaff
Incoming foreign keys
NameColumnsReferencing tableDescription
FK_Integration_Invoice__Invoice__invoice_KEYinvoice_KEYIntegration_Invoiceon delete cascade;
FK_Invoice_Office__Invoice__ledger_entry_KEYledger_entry_KEYInvoice_Officeon delete cascade;
FK_Online_Invoice__Invoice__ledger_entry_KEYledger_entry_KEYOnline_Invoiceon delete cascade;
FK_Report_Definition_Update_List__Invoice__invoice_KEYinvoice_KEYReport_Definition_Update_Liston delete cascade;
FK_Billing_Decision__Invoice__invoice_KEYinvoice_KEYBilling_Decision
FK_Billing_Decision__Invoice__ledger_entry_KEYledger_entry_KEYBilling_Decision
FK_Billing_Decision_Collection__Invoice__from__ledger_entry_KEYfrom__ledger_entry_KEYBilling_Decision_Collectionon delete cascade;
FK_Billing_Decision_Tax_Collection__Invoice__from__ledger_entry_KEYfrom__ledger_entry_KEYBilling_Decision_Tax_Collectionon delete cascade;

Schema diagram