Exact.Sales.SalesInvoice (exact_online v0.1.0)

Copy Markdown View Source

Sales invoices, including their lines.

Lines live in the "SalesInvoiceLines" navigation property. They are not returned by default, so ask for them explicitly, and send them nested when creating an invoice:

Exact.Sales.SalesInvoice.list(client, expand: ["SalesInvoiceLines"])

Exact.Sales.SalesInvoice.create(client, %{
  "OrderedBy" => account_id,
  "SalesInvoiceLines" => [
    %{"Item" => item_id, "Quantity" => 2, "UnitPrice" => 12.50}
  ]
})

Reference: SalesInvoices

Summary

Functions

Fetches one record by its InvoiceID. See Exact.Client.get/3.

The primary key field of this resource.

The path of this resource, relative to the division.

The path of a single record, including the key predicate.

Updates a record with the given fields. See Exact.Client.put/4.

Functions

create(client, attrs, opts \\ [])

@spec create(Exact.Client.t(), map(), keyword()) ::
  {:ok, map() | nil} | {:error, Exact.Error.t()}

Creates a record. See Exact.Client.post/4.

delete(client, id, opts \\ [])

@spec delete(Exact.Client.t(), term(), keyword()) ::
  {:ok, nil} | {:error, Exact.Error.t()}

Deletes a record. See Exact.Client.delete/3.

get(client, id, opts \\ [])

@spec get(Exact.Client.t(), term(), keyword()) ::
  {:ok, map() | nil} | {:error, Exact.Error.t()}

Fetches one record by its InvoiceID. See Exact.Client.get/3.

key()

@spec key() :: String.t()

The primary key field of this resource.

list(client, opts \\ [])

@spec list(Exact.Client.t(), keyword()) ::
  {:ok, Exact.Page.t()} | {:error, Exact.Error.t()}

Fetches one page. See Exact.Client.list/3.

path()

@spec path() :: String.t()

The path of this resource, relative to the division.

path(id)

@spec path(term()) :: String.t()

The path of a single record, including the key predicate.

Useful for the endpoints this module does not wrap, such as an action or a navigation property.

stream(client, opts \\ [])

@spec stream(Exact.Client.t(), keyword()) :: Enumerable.t()

Streams every record. See Exact.Client.stream/3.

update(client, id, attrs, opts \\ [])

@spec update(Exact.Client.t(), term(), map(), keyword()) ::
  {:ok, map() | nil} | {:error, Exact.Error.t()}

Updates a record with the given fields. See Exact.Client.put/4.