Table: Integration_Invoice
Columns
Name | Type | Constraints | Description
integration_invoice_KEY | int | NOT NULL | AUTO-INCREMENT: Database assigned primary key for this table
row_version | timestamp | NOT NULL |
update__staff_KEY | int | NOT NULL |
update_date | datetime | NOT NULL |
create_date | datetime | NOT NULL |
invoice_KEY | int | NOT NULL | Key to the Invoice record created for this exported invoice.
integration_application_KEY | int | NOT NULL | Key to a record in Integration_Application indicating which application exported this data.
integration_date | datetime | NOT NULL | Date the data was exported from the remote application.
user_name | nvarchar (30) | NOT NULL | User name of the person who triggered the export.
client_id | nvarchar (11) | NOT NULL | The Client ID that this invoice is for (in text form).
tin | nvarchar (11) | NOT NULL | TIN of the client the invoice is for.
entity | nvarchar (11) | NOT NULL | Entity as defined by the exporting applciation.
fiscal_year_end | smalldatetime |  | FYE as defined by the exporting applciation.
invoice_number | nvarchar (30) | NOT NULL | Invoice number as it is in the exporting application.
reference | nvarchar (30) | NOT NULL | User defined reference for this entry.
invoice_date | smalldatetime |  | Date of the invoice.
due_date | smalldatetime |  | Due date
billed_date | smalldatetime |  | Date this integration_invoice was saved.
time_amount_billed | decimal (17, 2) | NOT NULL | If the exporting application understands time and expense, the amount of the invoice that should be matched up with time. (Optional)
expense_amount_billed | decimal (17, 2) | NOT NULL | If the exporting application understands time and expense, the amount of the invoice that should be matched up with expense. (Optional)
progress_amount_billed | decimal (17, 2) | NOT NULL | If the exporting application understands time and expense, the amount of the invoice that should be matched up with progress. (Optional)
total_amount_billed | decimal (17, 2) | NOT NULL | Total amount of WIP billed by the invoice.
surcharge | decimal (17, 2) | NOT NULL | The surcharge amount on this integration_invoice (always 0 or positive.)
discount | decimal (17, 2) | NOT NULL | The discount amount on this integration_invoice (always 0 or negative.)
sales_tax | decimal (17, 2) | NOT NULL | Amount of sales tax on this invoice.
service_tax | decimal (17, 2) | NOT NULL | Amount of service tax on this invoice.
amount | decimal (17, 2) | NOT NULL | The total amount of this item.
prior_payment_amount | decimal (17, 2) | NOT NULL | Total amount of all prior payments received at the time of this invoice.
approved_date | smalldatetime |  | Date this item was approved.
posted_date | smalldatetime |  | Date this item was posted.
comments | nvarchar (-1) | NOT NULL | Comments about this item that can be included on reports.

Primary key
Name | Columns | Description
PK_Integration_Invoice$integration_invoice_KEY | integration_invoice_KEY | CLUSTERED
Unique constraints
Name | Columns | Description
UK_Integration_Invoice__invoice_KEY | invoice_KEY |
Indexes
Name | Columns | Description
IX_Integration_Invoice$integration_application_KEY | integration_application_KEY | Index supports foreign key FK_Integration_Invoice__Integration_Application__integration_application_KEY

Foreign keys
Name | Columns | Referenced table | Description
FK_Integration_Invoice__Integration_Application__integration_application_KEY | integration_application_KEY | Integration_Application |
FK_Integration_Invoice__Invoice__invoice_KEY | invoice_KEY | Invoice | on delete cascade;

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Integration_Invoice_Prior_Payment__Integration_Invoice__integration_invoice_KEY | integration_invoice_KEY | Integration_Invoice_Prior_Payment | on delete cascade;