BexioApiClient.Purchase (bexio_api_client v0.7.0)
Purchase Part of the API
Link to this section Summary
Functions
Endpoint for retrieving Bills
Link to this section Types
Link to this type
api_error_type()
@type api_error_type() :: BexioApiClient.Helpers.api_error_type()
Link to this type
bill_search_args()
@type bill_search_args() :: [ bill_date_start: Date.t(), bill_date_end: Date.t(), due_date_start: Date.t(), due_date_end: Date.t(), vendor_ref: String.t(), title: String.t(), currency_code: String.t(), pending_amount_min: float(), pending_amount_max: float(), vendor: String.t(), gross_min: float(), gross_max: float(), net_min: float(), net_max: float(), document_no: String.t(), supplier_id: integer(), status: :drafts | :todo | :paid | :overdue ]
Link to this section Functions
Link to this function
fetch_bills(req, search_term \\ nil, fields \\ nil, search_args \\ [], opts \\ [])
@spec fetch_bills( req :: Req.Request.t(), search_term :: String.t() | nil, fields :: [String.t()] | nil, search_args :: bill_search_args(), opts :: [BexioApiClient.GlobalArguments.paging_arg()] ) :: {:ok, {[BexioApiClient.Purchase.Bill.t()], BexioApiClient.Global.Paging.t()}} | api_error_type()
Endpoint for retrieving Bills
arguments
Arguments:
:client
- client to execute the HTTP request with:limit
- limit the number of results (default: 500, max: 2000):page
- current page:order
- sorting order, exampleorder=asc&order=desc
:sort
- field to sort by, examplesort=document_no
:search_term
- term for which application will look for (minimum 3 signs, maximum 255 signs), examplesearch_term=term
:fields
- Items enum, fields for which search will be run (if no fields specified then searching will be done for all allowed fields):status
- filter for Bill 'status' (DRAFTS: [DRAFT], TODO: [BOOKED, PARTIALLY_CREATED, CREATED, PARTIALLY_SENT, SENT, PARTIALLY_DOWNLOADED, DOWNLOADED, PARTIALLY_PAID, PARTIALLY_FAILED, FAILED], PAID: [PAID], OVERDUE: [BOOKED, PARTIALLY_CREATED, CREATED, PARTIALLY_SENT, SENT, PARTIALLY_DOWNLOADED, DOWNLOADED, PARTIALLY_PAID, PARTIALLY_FAILED, FAILED]) and for 'onlyOverdue' (DRAFTS: [FALSE], TODOS: [FALSE], PAID: [FALSE], OVERDUE: [TRUE]). Choosing OVERDUE means that only Bills with 'due_date' before now will be shown