Appearance
dbo.primeAccountsReceivableInvoices
Info Generated by
scripts/Generate-DataDictionary.ps1- do not edit by hand. Edit descriptions inschemas/tables/dbo.primeAccountsReceivableInvoices.jsonand regenerate.
Columns
| # | Column | Type | Nullable | Flags | Description |
|---|---|---|---|---|---|
| 1 | Id | uniqueidentifier | no | Primary key / unique identifier for this record | |
| 2 | JobId | uniqueidentifier | no | Foreign key to primeJobs | |
| 3 | InvoiceNumber | nvarchar(50) | no | Invoice number/reference | |
| 4 | InvoiceStatus | varchar(20) | no | Status of the invoice (e.g. Draft, Sent, Paid) | |
| 5 | AccountNumber | nvarchar(50) | yes | Accounting system account number | |
| 6 | InvoicedDate | date | yes | Date the invoice was issued | |
| 7 | DueDate | date | yes | Date this item is due | |
| 8 | Notes | nvarchar(MAX) | yes | Free-text internal notes | |
| 9 | Subtotal | decimal(19,4) | no | Subtotal amount before tax | |
| 10 | Total | decimal(19,4) | no | Total monetary amount | |
| 11 | TaxTotal | decimal(19,4) | no | Total tax amount | |
| 12 | ProgressPaymentNumber | int | yes | Sequence number of this progress payment/invoice | |
| 13 | ProgressPaymentPercentage | decimal(19,8) | yes | Percentage of the total job value this progress payment represents | |
| 14 | AccountsReceivableType | nvarchar(50) | yes | Type/category of accounts-receivable entry | |
| 15 | ShowExcessAs | nvarchar(50) | yes | How the excess amount should be displayed/handled | |
| 16 | InvoicedTo | uniqueidentifier | yes | Contact/entity the invoice was issued to | |
| 17 | AttachmentId | uniqueidentifier | yes | Foreign key to primeAttachment | |
| 18 | SentToClient | bit | no | Flag indicating whether the message was sent to the client | |
| 19 | CreatedAt | datetime2(3) | yes | Timestamp the record was created | |
| 20 | CreatedBy | nvarchar(100) | yes | User/system that created the record | |
| 21 | UpdatedAt | datetime2(3) | yes | Timestamp the record was last updated | |
| 22 | UpdatedBy | nvarchar(100) | yes | User/system that last updated the record | |
| 23 | IsSynced | bit | no | Flag indicating whether this record has been synced with Prime Ecosystem | |
| 24 | Version | bigint | yes | Optimistic-concurrency row version number | |
| 25 | Deleted | bit | no | Flag indicating whether this record has been soft-deleted | |
| 26 | DeletedAt | datetime | yes | Timestamp the record was soft-deleted |
Indexes
| Name | Type | Unique | PK | Key columns | Included | Filter |
|---|---|---|---|---|---|---|
| IX_AR_Invoice_JobId | NONCLUSTERED | JobId | ||||
| IX_AR_Invoice_InvoicedDate | NONCLUSTERED | InvoicedDate | ||||
| IX_AR_Invoice_Status | NONCLUSTERED | InvoiceStatus |
Relationships (inferred)
| From | To | Confidence |
|---|---|---|
| dbo.ethPrimeInvoiceUser.primeAccountsReceivableInvoicesId | dbo.primeAccountsReceivableInvoices.Id | low |
| dbo.primeAccountsReceivableInvoices.InvoicedTo | dbo.primeContacts.id | medium |
| dbo.primeAccountsReceivableInvoicesItem.InvoiceId | dbo.primeAccountsReceivableInvoices.Id | high |
| dbo.primeAccountsReceivableInvoices.JobId | dbo.primeJobs.Id | high |
Referenced by
Views: dbo.vPrimeJobinvoicesObjectivedb, dbo.vPrimeSalesinvoicesObjectivedb
Procedures: dbo.spEthSyncQueueMissingObjects, dbo.spPopulateInvoiceCheck, dbo.spPrimeUpsertAccountsReceivableInvoice

