ExpenseReports
class ExpenseReports extends DolibarrApi (View source)
API class for Expense Reports
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| static string[] | $FIELDSLINE | ||
| static string[] | $FIELDSPAYMENT | ||
| ExpenseReport | $expensereport |
Methods
Constructor
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensible object datas
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Get an expense report
List expense reports
Create an expense report
Get lines of an expense report
Add a line to an expense report
Update a line of an expense report
Delete a line from an expense report
Update expense report general fields
Delete expense report
Set an expense report to draft
Validate an expense report
Approve an expense report
Deny an expense report
Cancel an expense report
Get the list of payments of an expense report
Get an expense report payment
Create a payment for an expense report
Update a payment of an expense report
Details
__construct()
Constructor
protected string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)
Check and convert a string depending on its type/name.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensible object datas
static protected bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')
Check access by user to a given resource
protected bool|string
_checkFilters(string $sqlfilters, string $error = '')
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
static protected string
_forge_criteria_callback(string[] $matches)
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
object
get(int $id)
Get an expense report
Return an array with Expense Report information
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $user_ids = '', string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List expense reports
Get a list of Expense Reports
int
post(array $request_data = null)
Create an expense report
array
getLines(int $id)
Get lines of an expense report
int
postLine(int $id, array $request_data = null)
Add a line to an expense report
object|false
putLine(int $id, int $lineid, array $request_data = null)
Update a line of an expense report
object
deleteLine(int $id, int $lineid)
Delete a line from an expense report
object
put(int $id, array $request_data = null)
Update expense report general fields
Does not touch lines of the expense report
array
delete(int $id)
Delete expense report
object
setToDraft(int $id)
Set an expense report to draft
object
validate(int $id, int $notrigger = 0)
Validate an expense report
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
approve(int $id, int $notrigger = 0)
Approve an expense report
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
deny(int $id, string $details, int $notrigger = 0)
Deny an expense report
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
object
cancel(int $id, string $detail, int $notrigger = 0)
Cancel an expense report
array
getAllPayments(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0)
Get the list of payments of an expense report
object
getPayments(int $pid)
Get an expense report payment
int
addPayment(int $id, array $request_data = null)
Create a payment for an expense report
object
updatePayment(int $id, array $request_data = null)
Update a payment of an expense report