Skip to content

dbo.PrimeAccountsPayableInvoices ​

Info Generated by scripts/Generate-DataDictionary.ps1 - do not edit by hand. Edit descriptions in schemas/tables/dbo.PrimeAccountsPayableInvoices.json and regenerate.

Columns ​

#ColumnTypeNullableFlagsDescription
1AccountsPayableInvoiceIduniqueidentifiernoForeign key to primeAccountsPayableInvoices
2Typenvarchar(100)noCategory/type classification of this record
3JobIduniqueidentifieryesForeign key to primeJobs
4InvoiceNumbernvarchar(100)yesInvoice number/reference
5WorkOrderIduniqueidentifieryesForeign key to primeWorkOrders
6WorkOrderAssignedIduniqueidentifieryesForeign key to primeUsers/primeContacts - who the work order is assigned to
7AccountsPayableInvoiceStatusnvarchar(50)yesStatus of the accounts-payable invoice
8AccountNumbernvarchar(50)yesAccounting system account number
9ItemCodenvarchar(100)yesItem/product code
10Amountdecimal(18,4)yesMonetary amount
11Taxdecimal(18,4)yesTax amount
12TaxTotaldecimal(18,4)yesTotal tax amount
13InvoicedDatedateyesDate the invoice was issued
14DueDatedateyesDate this item is due
15AttachmentIduniqueidentifieryesForeign key to primeAttachment
16ApprovalStatusnvarchar(50)yesApproval status of this record
17ApprovalNotenvarchar(MAX)yesFree-text note explaining the approval decision
18ApprovedBynvarchar(255)yesUser who approved this record
19ApprovedAtdatetime2(7)yesTimestamp this record was approved
20ReserveItemIdsJsonnvarchar(MAX)yesJSON array of reserve item identifiers related to this record
21CreatedAtdatetime2(7)yesTimestamp the record was created
22CreatedBynvarchar(255)yesUser/system that created the record
23UpdatedAtdatetime2(7)yesTimestamp the record was last updated
24UpdatedBynvarchar(255)yesUser/system that last updated the record
25IsSyncedbitnoFlag indicating whether this record has been synced with Prime Ecosystem
26FinalInvoicebitnoFlag indicating this is the final invoice for the job
27VersionbigintyesOptimistic-concurrency row version number

Indexes ​

NameTypeUniquePKKey columnsIncludedFilter
PK_PrimeAccountsPayableInvoicesCLUSTEREDyesyesAccountsPayableInvoiceId
IX_Accountpayable_workorderNONCLUSTEREDInvoiceNumber, Amount, AccountsPayableInvoiceStatusAccountsPayableInvoiceId, AttachmentId, JobId, WorkOrderAssignedId, WorkOrderId
IX_PrimeAPInvoices_JobIdNONCLUSTEREDJobIdAccountsPayableInvoiceStatus, Amount, ApprovalStatus, DueDate, InvoicedDate, InvoiceNumber, TaxTotal
IX_PrimeAPInvoices_WorkOrderIdNONCLUSTEREDWorkOrderIdAccountsPayableInvoiceStatus, Amount, TaxTotal, WorkOrderAssignedId

Relationships (inferred) ​

FromToConfidence
dbo.PrimeAccountsPayableInvoices.WorkOrderIddbo.primeWorkOrders.idhigh

Referenced by ​

Procedures: dbo.spEthQueueAccountsPayableInvoices, dbo.spPrimeUpsertAccountsPayableInvoice