# PurchaseInvoices: Bouw7 Purchase Invoices Returns a list of purchase invoices belonging to the organization. Returns a list of pruchase invoices belonging to the organization. - Catalog: `Bouw7` - Schema: `PurchaseInvoicing` - Label: Purchase Invoices This is a read-only table function. The Bouw7 API may not support changing the data or the Invantive UniversalSQL driver for Bouw7 does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Bouw7 API. ## Parameters of Table Function The following parameters can be used to control the behaviour of the table function `PurchaseInvoices`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values. Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three. Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third. | Name | Data Type | Required | Default Value | Documentation | |---|:---:|:---:|:---:|---| | `q` | `` | ☐ | | A [Heimdall Query Language](https://heimdall.bouw7.nl/docs/query-language) string | ## Columns of Table Function The columns of the table function `PurchaseInvoices` are shown below. Each column has an SQL data type. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `branch_id` | `int64` | Branch ID | ☐ | The ID of the branch. | | `branch_name` | `varchar2` | Branch Name | ☐ | The name of the branch. | | `chainLiabilityDocumentExpirationDate` | `datetime` | Chain Liability Document Expiration Date | ☐ | The newest expiration date of the chain liability document(s) associated with the contact, in ATOM format. | | `comment` | `varchar2` | Comment | ☐ | A comment placed on this purchase invoice. | | `createdAt` | `datetime` | Created at | ☐ | The creation date of the object in ATOM/ISO-8601 format | | `createdBy_id` | `int64` | Created by ID | ☐ | The ID of the user. | | `createdBy_username` | `varchar2` | Created by User Name | ☐ | The username of the user. | | `currentApprover` | `varchar2` | Current Approver | ☐ | The full name of the current approver. | | `date` | `datetime` | Date | ☐ | The entry date of this purchase invoice. | | `datePaid` | `varchar2` | Date Paid | ☐ | The date this purchase invoice was paid. | | `deliveryTicket_bookingStatus` | `int64` | Delivery Ticket Booking Status | ☐ | The current booking status. 0 = Registered, 1 = Invoiced, 2 = Not billable, 3 = Credited. | | `deliveryTicket_date` | `datetime` | Delivery Ticket Date | ☐ | The date of the delivery ticket, represented in ATOM-format. | | `deliveryTicket_description` | `varchar2` | Delivery Ticket Description | ☐ | The description of this delivery ticket. May contain HTML content. | | `deliveryTicket_id` | `int64` | Delivery Ticket ID | ☐ | The ID of this delivery ticket. | | `deliveryTicket_isProcessed` | `char` | Delivery Ticket Is Processed | ☐ | Whether this delivery ticket has been processed. | | `deliveryTicket_number` | `varchar2` | Delivery Ticket Number | ☐ | The ticket number of this delivery ticket. | | `deliveryTicket_price` | `varchar2` | Delivery Ticket Price | ☐ | The price of this delivery ticket. | | `deliveryTicket_purchaseTypeId` | `int64` | Delivery Ticket Purchase Type ID | ☐ | The ID of the purchase type of this delivery ticket. | | `deliveryTicket_purchaseTypeName` | `varchar2` | Delivery Ticket Purchase Type Name | ☐ | The name of the purchase type of this delivery ticket. | | `division_description` | `varchar2` | Division Description | ☐ | The description of the division. | | `division_exactDivisionId` | `varchar2` | Division Exact Division ID | ☐ | The division ID of an Exact Online environment. | | `division_glAccountCode` | `varchar2` | Division General Ledger Account Code | ☐ | A default general ledger account code to use for sales related items. | | `division_glAccountCodePurchase` | `varchar2` | Division General Ledger Account Code Purchase | ☐ | A default general ledger account code to use for purchase related items. | | `division_id` | `int64` | Division ID | ☐ | The ID of the division. | | `division_journalCode` | `varchar2` | Division Journal Code | ☐ | A default journal code to use for sales related items. | | `division_journalCodePurchase` | `varchar2` | Division Journal Code Purchase | ☐ | A default journal code to use for purchase related items. | | `dueDate` | `datetime` | Due Date | ☐ | The due date of this purchase invoice. | | `entryNumber` | `int64` | Entry Number | ☐ | A sequential tracking number assigned to this purchase invoice. Also known as voucher number, serial number or tracking number. | | `id` | `int64` | ID | ☐ | The ID of this purchase invoice. | | `invoiceNumber` | `varchar2` | Invoice Number | ☐ | The invoice number of this purchase invoice. | | `isBookedInExact` | `char` | Is Booked in Exact | ☐ | Whether this purchase invoice is booked in Exact. | | `isBookedInTwinfield` | `char` | Is Booked in Twinfield | ☐ | Whether this purchase invoice is booked in Twinfield. | | `isMutable` | `char` | | ☐ | Whether the purchase invoice is mutable. | | `isOriginatingFromBasecone` | `char` | Is Originating from Basecone | ☐ | Whether this purchase invoice originates from Basecone. | | `orderNumber` | `varchar2` | Order Number | ☐ | The order number associated with this purchase invoice. | | `paymentReference` | `varchar2` | Payment Reference | ☐ | The payment reference of this purchase invoice. | | `project_branchId` | `int64` | Project Branch ID | ☐ | The ID of the branch of this project. | | `project_categoryId` | `int64` | Project Category ID | ☐ | The ID of the category of this project. | | `project_divisionId` | `int64` | Project Division ID | ☐ | The ID of the division of this project. | | `project_id` | `int64` | Project ID | ☐ | The ID of the project. | | `project_name` | `varchar2` | Project Name | ☐ | The name of the project. | | `project_number` | `varchar2` | Project Number | ☐ | The number of the project. | | `project_status` | `varchar2` | Project Status | ☐ | The name of the current status of this project. | | `project_statusId` | `int64` | Project Status ID | ☐ | The ID of the status of this project. | | `status` | `int64` | Status | ☐ | The status of this purchase invoice. (0 = New, 1 = Approved, 2 = Open, 3 = Expired, 4 = Paid, 5 = Declined) | | `subTotal` | `varchar2` | Subtotal | ☐ | The sum of all purchase invoice line subtotals, excluding VAT. | | `supplier_emailAddress` | `varchar2` | Supplier Email Address | ☐ | The email address of the contact. | | `supplier_id` | `int64` | Supplier ID | ☐ | The ID of the contact. | | `supplier_name` | `varchar2` | Supplier Name | ☐ | The name of this contact. | | `supplier_type` | `varchar2` | Supplier Type | ☐ | The type of this contact. | | `supplier_typeId` | `int64` | Supplier Type ID | ☐ | The type ID of this contact. | | `total` | `varchar2` | Total | ☐ | The sum of all purchase invoice line subtotals, including VAT. | | `updatedAt` | `datetime` | Updated At | ☐ | The creation date of the object in ATOM/ISO-8601 format | | `updatedBy_id` | `int64` | Updated by ID | ☐ | The ID of the user. | | `updatedBy_username` | `varchar2` | Updated by User Name | ☐ | The username of the user. | | `vatTotal` | `varchar2` | VAT Total | ☐ | The sum of all purchase invoice line VAT totals. |