# SalesOrderRotRutDistributions Gets a paged list with sales orders of any type. Sample requests: `GET /salesorders` `GET /salesorders?customerId=10000&status=Open&pageSize=10` `GET /salesorders?orderBy=lastModified%20asc` `GET /salesorders?expand=all&pageSize=100` When any `expand` value is specified, the effective maximum `pageSize` is `100`. ## Documentation Sample requests: `GET /salesorders` `GET /salesorders?customerId=10000&status=Open&pageSize=10` `GET /salesorders?orderBy=lastModified%20asc` `GET /salesorders?expand=all&pageSize=100` When any `expand` value is specified, the effective maximum `pageSize` is `100`. - Catalog: `NgSalesOrders` - Schema: `SalesOrders` This is a read-only table function. The Visma.net Financials API may not support changing the data or the Invantive UniversalSQL driver for Visma.net Financials does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Visma.net Financials API. ## Parameters of Table Function The following parameters can be used to control the behaviour of the table function `SalesOrderRotRutDistributions`. 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 | |---|:---:|:---:|:---:|---| | `customerId` | `` | ☐ | | The customer for which to retrieve orders. If omitted or empty, orders for all customers are included | | `modifiedSince` | `` | ☐ | | A date/time value for filtering when a sales order last changed. Unless a specific time zone offset is included (e.g. '2012-12-24T12:15:14+02:00'), the date is considered to be in the UTC time zone. | | `status` | `` | ☐ | | The order status to include in the result. If omitted or empty, orders with any status are included. | ## Columns of Table Function The columns of the table function `SalesOrderRotRutDistributions` are shown below. Each column has an SQL data type. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `COMPANY_CODE` | `varchar2(30)` | Company Code | ☑ | Partition code, segmenting the data. | | `COMPANY_NAME` | `varchar2(240)` | Company Name | ☑ | Name of the partition. | | `amount` | `double` | Amount | ☐ | The amount | | `apartment` | `varchar2` | | ☐ | The apartment reference | | `billing_address_city` | `varchar2` | | ☐ | The city | | `billing_address_country_id` | `varchar2` | | ☐ | The id | | `billing_address_country_name` | `varchar2` | | ☐ | The name | | `billing_address_county_id` | `varchar2` | | ☐ | The id | | `billing_address_county_name` | `varchar2` | | ☐ | The name | | `billing_address_id` | `int32` | | ☐ | The address id | | `billing_address_line1` | `varchar2` | | ☐ | Address line 1 | | `billing_address_line2` | `varchar2` | | ☐ | Address line 2 | | `billing_address_line3` | `varchar2` | | ☐ | Address line 3 | | `billing_address_overridesDefault` | `char` | | ☐ | Whether this address overrides the default address | | `billing_address_postalCode` | `varchar2` | | ☐ | The postal code | | `billing_contact_attention` | `varchar2` | | ☐ | Any attention for the contact | | `billing_contact_email` | `varchar2` | | ☐ | The e-mail address of the contact | | `billing_contact_fax` | `varchar2` | | ☐ | The fax number of the contact | | `billing_contact_id` | `int32` | | ☐ | The id of the contact | | `billing_contact_name` | `varchar2` | | ☐ | The name of the contact | | `billing_contact_overridesDefault` | `char` | | ☐ | Whether this overrides the default contact | | `billing_contact_phone1` | `varchar2` | | ☐ | The phone number of the contact | | `billing_contact_phone2` | `varchar2` | | ☐ | The secondary phone number of the contact | | `branch_description` | `varchar2` | | ☐ | The description | | `branch_id` | `varchar2` | | ☐ | The id | | `c_links` | `varchar2` | | ☐ | Links applicable for the dto The JSON text of the nested object. | | `cancelBy` | `datetime` | Cancel by | ☐ | The cancel date for the order | | `createdBy` | `varchar2` | | ☐ | The user name of the creator of the order. If the order was created by an API call this field will be null or empty. | | `currencyRate` | `double` | | ☐ | The currency rate of the order. To calculate the order amount in base currency, take the order amount and multiply with the currencyRate. | | `currency` | `varchar2` | Currency | ☐ | The currency id for the order | | `customFields_customDateTimeUtc1` | `datetime` | | ☐ | A free custom colum of type DateTime - in UTC timezone | | `customFields_customDec1` | `double` | | ☐ | A free custom colum of type decimal with max 4 decimals. | | `customFields_customDec2` | `double` | | ☐ | A free custom colum of type decimal with max 4 decimals. | | `customFields_customInt1` | `int32` | | ☐ | A free custom colum of type int | | `customFields_customInt2` | `int32` | | ☐ | A free custom colum of type int | | `customFields_customStr1` | `varchar2` | | ☐ | A free custom colum of type string with max length 100. | | `customFields_customStr2` | `varchar2` | | ☐ | A free custom colum of type string with max length 100. | | `customFields_customStr3` | `varchar2` | | ☐ | A free custom colum of type string with max length 100. | | `customFields_customStr4` | `varchar2` | | ☐ | A free custom colum of type string with max length 100. | | `customFields_customStr5` | `varchar2` | | ☐ | A free custom colum of type string with max length 100. | | `customerId` | `varchar2` | | ☐ | The customer Id for the order (a.k.a CustomerCd) | | `customerName` | `varchar2` | | ☐ | The name of the customer as it appears on the order | | `customerOrder` | `varchar2` | Customer Order | ☐ | The customer order link | | `customerRefNo` | `varchar2` | Customer Reference Number | ☐ | The order reference number of the customer | | `customer_contactId` | `int32` | | ☐ | The contact id for the customer | | `customer_id` | `varchar2` | | ☐ | The unique id of the the customer | | `customer_internalId` | `int32` | Customer Internal ID | ☐ | An internal unique id of the customer | | `customer_location_corporateId` | `varchar2` | | ☐ | The corporate id of the location | | `customer_location_countryId` | `varchar2` | | ☐ | The country code of the location | | `customer_location_gln` | `varchar2` | | ☐ | The global localization number of the location | | `customer_location_id` | `varchar2` | | ☐ | Location id | | `customer_location_internalId` | `int32` | | ☐ | An internal id of the customer location | | `customer_location_name` | `varchar2` | | ☐ | Location description | | `customer_location_taxRegistrationId` | `varchar2` | | ☐ | The tax registration id of the location | | `customer_location_warehouseId` | `varchar2` | | ☐ | The site id of the location | | `customer_name` | `varchar2` | Customer Name | ☐ | The customer name | | `customer_order` | `varchar2` | | ☐ | The customer order text | | `customer_refNo` | `varchar2` | | ☐ | The customer ref number text | | `customer_taxZone_description` | `varchar2` | | ☐ | The description | | `customer_taxZone_id` | `varchar2` | | ☐ | The id | | `date` | `datetime` | Date | ☐ | | | `description` | `varchar2` | Description | ☐ | Any description on the order | | `distributedAmount` | `double` | Distributed Amount | ☐ | The total amount distributed among the specified personal IDs | | `distributedAutomatically` | `char` | | ☐ | Whether the ROT/RUT is distributed automatically | | `emailed` | `char` | Emailed | ☐ | Indicates if the document was emailed | | `estate` | `varchar2` | Estate | ☐ | The estate reference | | `extra` | `char` | Extra | ☐ | Whether this is extra or not | | `financialInformation_cashDiscountDate` | `datetime` | | ☐ | | | `financialInformation_dueDate` | `datetime` | | ☐ | | | `financialInformation_invoiceDate` | `datetime` | | ☐ | | | `financialInformation_invoiceId` | `varchar2` | | ☐ | The id of the invoice issued for the order | | `financialInformation_invoiceSeparately` | `char` | | ☐ | Whether the order should be invoiced separately | | `financialInformation_postPeriod` | `varchar2` | | ☐ | The post period for the invoice | | `financialInformation_terms_description` | `varchar2` | | ☐ | The description | | `financialInformation_terms_id` | `varchar2` | | ☐ | The id | | `freight_amountInBaseCurrency` | `double` | | ☐ | The amounts calculated based on the ship terms in base currency of the order. | | `freight_amount` | `double` | | ☐ | The amounts calculated based on the ship terms. /// | | `freight_costInBaseCurrency` | `double` | | ☐ | The freight cost calculated for the sales order in base currency. | | `freight_cost` | `double` | | ☐ | The freight cost calculated for the sales order, | | `freight_premiumAmountInBaseCurrency` | `double` | | ☐ | The additional freight charges in base currency for handling the order. | | `freight_premiumAmount` | `double` | | ☐ | The additional freight charges for handling the order. | | `freight_taxCategoryId` | `varchar2` | | ☐ | The tax category that applies to the freight amount. By default, it is the tax category associated with the ship via code selected for the order. | | `freight_volume` | `double` | | ☐ | | | `freight_weight` | `double` | | ☐ | | | `isRotRutDeductible` | `char` | | ☐ | Whether the order is ROT/RUT deductible | | `lastModified` | `datetime` | Last Modified | ☐ | The date and time the order was last modified | | `lineId` | `int32` | Line Identifier | ☐ | Reference to the order line | | `location` | `varchar2` | | ☐ | The customer location for this order | | `materialCostAmount` | `double` | | ☐ | Cost amount for lines with inventory ROT/RUT item type Material | | `note` | `varchar2` | Note | ☐ | Any notes on the order | | `orderId` | `varchar2` | | ☐ | The order id (a.k.a OrderCd) for the order | | `orderQty` | `double` | Order Quantity | ☐ | The total number of items on the order | | `orderTotal` | `double` | Order Total | ☐ | The total amount on the order | | `organizationNumber` | `varchar2` | Organisation Number | ☐ | The organization number | | `origin__links` | `varchar2` | | ☐ | Links applicable for the dto The JSON text of the nested object. | | `origin_orderId` | `varchar2` | | ☐ | The unique id of the origin order | | `origin_orderType` | `varchar2` | | ☐ | The order type code for the origin order | | `originalOrderId` | `varchar2` | | ☐ | The unique identifier of the original order | | `originalOrderType` | `varchar2` | | ☐ | The type code for the original sales order | | `otherCostAmount` | `double` | | ☐ | Cost amount for lines with inventory ROT/RUT item type OtherCost | | `owner_id` | `varchar2` | Owner ID | ☐ | The identifier of the employee | | `owner_internalId` | `varchar2` | Owner Internal ID | ☐ | The internal unique identifier of the employee | | `parentCustomer_id` | `varchar2` | | ☐ | The unique id of the the customer | | `parentCustomer_internalId` | `int32` | | ☐ | An internal unique id of the customer | | `parentCustomer_name` | `varchar2` | | ☐ | The customer name | | `paymentSettings_cashAccountId` | `varchar2` | | ☐ | The cash account to use | | `paymentSettings_paymentMethod_description` | `varchar2` | | ☐ | The description | | `paymentSettings_paymentMethod_id` | `varchar2` | | ☐ | The id | | `paymentSettings_paymentReference` | `varchar2` | | ☐ | The payment reference | | `personalId` | `varchar2` | Personal ID | ☐ | The personal id | | `print_descriptionOnInvoice` | `char` | | ☐ | Set to true to print description on the invoice | | `print_noteOnExternalDocuments` | `char` | | ☐ | Set to true to print note on external documents | | `print_noteOnInternalDocuments` | `char` | | ☐ | Set to true to print note on internal documents | | `project_description` | `varchar2` | Project Description | ☐ | The description | | `project_id` | `varchar2` | Project ID | ☐ | The id | | `project_internalId` | `int32` | | ☐ | An internal unique identifier of the project | | `requestOn` | `datetime` | Request On | ☐ | | | `salesPerson_description` | `varchar2` | Sales Person Description | ☐ | The description | | `salesPerson_id` | `varchar2` | Sales Person ID | ☐ | The id | | `shippingScheduledDate` | `datetime` | | ☐ | | | `shipping_address_city` | `varchar2` | | ☐ | The city | | `shipping_address_country_id` | `varchar2` | | ☐ | The id | | `shipping_address_country_name` | `varchar2` | | ☐ | The name | | `shipping_address_county_id` | `varchar2` | | ☐ | The id | | `shipping_address_county_name` | `varchar2` | | ☐ | The name | | `shipping_address_id` | `int32` | | ☐ | The address id | | `shipping_address_line1` | `varchar2` | | ☐ | Address line 1 | | `shipping_address_line2` | `varchar2` | | ☐ | Address line 2 | | `shipping_address_line3` | `varchar2` | | ☐ | Address line 3 | | `shipping_address_overridesDefault` | `char` | | ☐ | Whether this address overrides the default address | | `shipping_address_postalCode` | `varchar2` | | ☐ | The postal code | | `shipping_contact_attention` | `varchar2` | | ☐ | Any attention for the contact | | `shipping_contact_email` | `varchar2` | | ☐ | The e-mail address of the contact | | `shipping_contact_fax` | `varchar2` | | ☐ | The fax number of the contact | | `shipping_contact_id` | `int32` | | ☐ | The id of the contact | | `shipping_contact_name` | `varchar2` | | ☐ | The name of the contact | | `shipping_contact_overridesDefault` | `char` | | ☐ | Whether this overrides the default contact | | `shipping_contact_phone1` | `varchar2` | | ☐ | The phone number of the contact | | `shipping_contact_phone2` | `varchar2` | | ☐ | The secondary phone number of the contact | | `shipping_fobPoint_description` | `varchar2` | | ☐ | The description | | `shipping_fobPoint_id` | `varchar2` | | ☐ | The id | | `shipping_insurance` | `char` | | ☐ | Whether insurance applies to this shipping | | `shipping_intrastatTransactionType_description` | `varchar2` | | ☐ | The description | | `shipping_intrastatTransactionType_id` | `int32` | | ☐ | The id | | `shipping_preferredWarehouse_description` | `varchar2` | | ☐ | The description | | `shipping_preferredWarehouse_id` | `varchar2` | | ☐ | The id | | `shipping_priority` | `int32` | | ☐ | Priority of the order | | `shipping_residentialDelivery` | `char` | | ☐ | Whether this is residential delivery | | `shipping_rule` | `varchar2` | | ☐ | The shipping rule | | `shipping_saturdayDelivery` | `char` | | ☐ | Whether this is a saturday delivery | | `shipping_scheduledDate` | `datetime` | | ☐ | The shipping scheduled date | | `shipping_shipSeparately` | `char` | | ☐ | Whether this order can/is shipped separately | | `shipping_shipVia_description` | `varchar2` | | ☐ | The description | | `shipping_shipVia_id` | `varchar2` | | ☐ | The id | | `shipping_terms_description` | `varchar2` | | ☐ | The description | | `shipping_terms_id` | `varchar2` | | ☐ | The id | | `shipping_zone_description` | `varchar2` | | ☐ | The description | | `shipping_zone_id` | `varchar2` | | ☐ | The id | | `statusDetails_cancelled` | `char` | | ☐ | Whether this order is in a cancelled state | | `statusDetails_description` | `varchar2` | | ☐ | The status name for the order | | `statusDetails_hold` | `char` | | ☐ | Whether this order is in a held state | | `status` | `varchar2` | Status | ☐ | The current status of the order | | `taxTotal` | `double` | Tax Total | ☐ | The tax total | | `totalDeductableAmount` | `double` | | ☐ | The total amount that is tax deductable | | `totals_costTotalInBaseCurrency` | `double` | | ☐ | The total of the costs on the lines of the sales order in base currency. | | `totals_costTotal` | `double` | | ☐ | The total of the costs on the lines of the sales order. How the `costTotal` is calculated is dependent on the option `useReplacementCostForMarginAndProfit`. If this option is `true` the `costTotal` will be calculated based on the `replacementUnitCost`. If this option is `false`, the `costTotal` will be calculate based on `unitCost` | | `totals_discountTotalInBaseCurrency` | `double` | | ☐ | The discount total in base currency | | `totals_discountTotal` | `double` | | ☐ | The discount total | | `totals_exciseDutyTotalInBaseCurrency` | `double` | | ☐ | The sum of excise duty for the lines in base currency | | `totals_exciseDutyTotal` | `double` | | ☐ | The sum of excise duty for the lines | | `totals_freightCostInBaseCurrency` | `double` | | ☐ | The freight cost calculated for the sales order in base currency. Not applicable for transfer order types. | | `totals_freightCost` | `double` | | ☐ | The freight cost calculated for the sales order. Not applicable for transfer order types. | | `totals_freightTotalInBaseCurrency` | `double` | | ☐ | The freight amount calculated in accordance with the shipping terms in base currency. Not applicable for transfer order types. | | `totals_freightTotal` | `double` | | ☐ | The freight amount calculated in accordance with the shipping terms. Not applicable for transfer order types. | | `totals_orderTotalInBaseCurrency` | `double` | | ☐ | The order total in base currency | | `totals_orderTotal` | `double` | | ☐ | The order total | | `totals_paymentTotalInBaseCurrency` | `double` | | ☐ | The total amount of payments connected to the order in the base currency | | `totals_paymentTotal` | `double` | | ☐ | The total amount of payments connected to the order in the order currency | | `totals_taxExemptTotalInBaseCurrency` | `double` | | ☐ | The VAT exempt total in base currency | | `totals_taxExemptTotal` | `double` | | ☐ | The VAT exempt total | | `totals_taxTotalInBaseCurrency` | `double` | | ☐ | The tax total in base currency | | `totals_taxTotal` | `double` | | ☐ | The tax total | | `totals_taxableTotalInBaseCurrency` | `double` | | ☐ | The VAT taxable in base currency | | `totals_taxableTotal` | `double` | | ☐ | The VAT taxable total | | `totals_unbilledAmountInBaseCurrency` | `double` | | ☐ | The sum of unbilled amounts for the lines in base currency | | `totals_unbilledAmount` | `double` | | ☐ | The sum of unbilled amounts for the lines | | `totals_unshippedAmountInBaseCurrency` | `double` | | ☐ | The sum of unshipped amounts for the lines in base currency | | `totals_unshippedAmount` | `double` | | ☐ | The sum of unshipped amounts for the lines | | `type_2` | `varchar2` | | ☐ | The type of the order | | `type` | `varchar2` | Type | ☐ | The type of ROT/RUT | | `useReplacementCostForMarginAndProfit` | `char` | | ☐ | When this option is set to `true`, the `costTotal` of the order will be calculated based on `replacementUnitCost`. If option is set to `false`, the `costTotal` will be calculated based on `unitCost` | | `version` | `blob` | | ☐ | An internal order version used for detecting concurrent updates to an order | | `workPriceAmount` | `double` | | ☐ | Price amount for lines with inventory ROT/RUT item type Service |