Table: dbo.Client_Billing
Columns
Name | Type | Constraints | Description
client_billing_KEY | int (4) | NOT NULL | Primary key for this table; the client-level billing options
client_KEY | int (4) | NOT NULL | Foreign key; key of the associated client
exclude_agent_transactions | bit (1) | NOT NULL | Flag to exclude agent transactions from generating billing transactions
bill_to_other_client | bit (1) | NOT NULL | Flag to bill another client for this clients transactions
bill_to_other_client__client_KEY | int (4) |  | Foreign key; key of the billing client
prepayment_amount | decimal (9, 2) | NOT NULL | Amount of prepayment received from the client
prepayment_received_date | smalldatetime (4) |  | Date prepayment was received from the client
prepayment_applied_date | smalldatetime (4) |  | Date prepayment was applied to an invoice
discount_type | int (4) | NOT NULL | Type of discount the value field contains (0=Percentage, 1=Amount)
discount_value | decimal (9, 4) | NOT NULL | Discount value to be applied to clients invoice
discount_begin_date | smalldatetime (4) |  | Date the discount become effective
discount_end_date | smalldatetime (4) |  | Date the discount ends
discount_description | nvarchar (480) | NOT NULL | Discount description to use on the invoice
fees__gl_account_KEY | int (4) |  | Key to the gl_account for billing fees.
delivery__gl_account_KEY | int (4) |  | Key to the gl_account for billing delivery.
discount__gl_account_KEY | int (4) |  | Key to the gl_account for billing discounts.
create_fees_as_final | bit (1) | NOT NULL | Flag; if true, then clients fees are finalized at the time they are created.
exclude_form_fees_from_create_as_final | bit (1) | NOT NULL | Whether or not form fees should be excluded from create fees as final.

Primary key
Name | Columns | Description
PK_Client_Billing | client_billing_KEY |
Unique constraints
Name | Columns | Description
UK_Client_Billing$client_KEY | client_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_Client_Billing__Client__bill_to_other_client__client_KEY | bill_to_other_client__client_KEY | Client (client_KEY) |
FK_Client_Billing__Client__client_KEY | client_KEY | Client (client_KEY) |
FK_Client_Billing__GL_Account__delivery__gl_account_KEY | delivery__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_Client_Billing__GL_Account__discount__gl_account_KEY | discount__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_Client_Billing__GL_Account__fees__gl_account_KEY | fees__gl_account_KEY | GL_Account (gl_account_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_BS_Client_Billing__Client__bill_to_other_client | client_billing_KEY | BS_Client_Billing__Client__bill_to_other_client |