Table: Billing_Decision
Columns
NameTypeConstraintsDescription
billing_decision_KEYintNOT NULLAUTO-INCREMENT: Database assigned primary key for this table
update__staff_KEYintNOT NULL
update_date_utcdatetimeNOT NULL
create_date_utcdatetimeNOT NULL
billing_decision_guiduniqueidentifierNOT NULLA unique key for this row generated in detail billing otherwise by the database.
invoice_KEYintNOT NULLThe Invoice this billing apears on.
sheet_entry_KEYintNOT NULLThe Sheet Entry this billing is for.
ledger_entry_KEYintNOT NULLThe Invoice this billing apears on (same as invoice_KEY column of Billing_Decision.)
bill_amountdecimal (9, 2)NOT NULLAmount billed for this invoice.
adjustmentdecimal (9, 2)NOT NULLAdjustment (a negative adjustment is a write down).
units_closeddecimal (9, 2)NOT NULLSheet Entry units closed out by this billing. wip_closed = bill_amount - adjustment.
surchargedecimal (9, 2)NOT NULLSurcharge applied to this item, calculated before discount (surcharge rate x bill_amount).
discountdecimal (9, 2)NOT NULLDiscount applied to this item.
sales_taxdecimal (9, 2)NOT NULLSum of Billing_Decision_Taxing_Authority.amount for this Billing_Decision for Taxing_Authority records of sales tax.
service_taxdecimal (9, 2)NOT NULLSum of Billing_Decision_Taxing_Authority.amount for this Billing_Decision for Taxing_Authority records of type service tax.
invoiceddecimal (9, 2)NOT NULLTotal amount that this Billing_Decision is invoiced, including taxes and discounts, if this Billing_Decision is billable. This is always calculated even it the Billing_Decision is non-billable.
recurring_billbitNOT NULLWhen set to 1 will indicate that this billing decision is from a recurring bill engagement. Billing decisions that existed prior to Practice CS 2011.2 will not be marked as recurring bill.
Primary key
NameColumnsDescription
PK_Billing_Decision$sheet_entry_KEY$ledger_entry_KEYsheet_entry_KEY, ledger_entry_KEYCLUSTERED
Unique constraints
NameColumnsDescription
UK_Billing_Decision$billing_decision_guidbilling_decision_guid
UK_Billing_Decision$billing_decision_KEYbilling_decision_KEY
UK_Billing_Decision$invoice_KEY$sheet_entry_KEYinvoice_KEY, sheet_entry_KEY
UK_Billing_Decision$ledger_entry_KEY$sheet_entry_KEYledger_entry_KEY, sheet_entry_KEY
Indexes
NameColumnsDescription
IX_Billing_Decision$invoice_KEY$sheet_entry_KEY$billing_decision_KEY$bill_amount$adjustmentinvoice_KEY, sheet_entry_KEY, billing_decision_KEY, bill_amount, adjustment
IX_Billing_Decision$ledger_entry_KEY@adjustment@bill_amount@discount@sheet_entry_KEY@surcharge@units_closedledger_entry_KEY, adjustment, bill_amount, discount, sheet_entry_KEY, surcharge, units_closedAn index by ledger_entry_KEY that covers adjustment, bill_amount, discount, sheet_entry_KEY, surcharge, units_closed.
About 50% of queries access Billing_Decision by ledger_entry_KEY and 50% by sheet_entry_KEY.
IX_Billing_Decision$sheet_entry_KEY$bill_amount$adjustmentsheet_entry_KEY, bill_amount, adjustment
Foreign keys
NameColumnsReferenced tableDescription
FK_Billing_Decision__Invoice__invoice_KEYinvoice_KEYInvoice
FK_Billing_Decision__Invoice__ledger_entry_KEYledger_entry_KEYInvoice
FK_Billing_Decision__Sheet_Entry__sheet_entry_KEYsheet_entry_KEYSheet_Entry
Incoming foreign keys
NameColumnsReferencing tableDescription
FK_Billing_Decision_Collection__Billing_Decision__sheet_entry_KEY__ledger_entry_KEYsheet_entry_KEY, ledger_entry_KEYBilling_Decision_Collectionon delete cascade;
FK_Billing_Decision_Taxing_Authority__Billing_Decision__billing_decision_KEYbilling_decision_KEYBilling_Decision_Taxing_Authority
FK_Billing_Decision_Taxing_Authority__Billing_Decision__sheet_entry_KEY__ledger_entry_KEYsheet_entry_KEY, ledger_entry_KEYBilling_Decision_Taxing_Authority

Schema diagram