|
dolibarr 24.0.0-beta
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get an expense report. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $user_ids='', $sqlfilters='', $properties='', $pagination_data=false) | |
| List expense reports. | |
| post ($request_data=null) | |
| Create an expense report. | |
| getLines ($id) | |
| Get lines of an expense report. | |
| postLine ($id, $request_data=null) | |
| Add a line to an expense report. | |
| putLine ($id, $lineid, $request_data=null) | |
| Update a line of an expense report. | |
| deleteLine ($id, $lineid) | |
| Delete a line from an expense report. | |
| put ($id, $request_data=null) | |
| Update expense report general fields. | |
| delete ($id) | |
| Delete expense report. | |
| setToDraft ($id) | |
| Set an expense report to draft. | |
| validate ($id, $notrigger=0) | |
| Validate an expense report. | |
| approve ($id, $notrigger=0) | |
| Approve an expense report. | |
| deny ($id, $details, $notrigger=0) | |
| Deny an expense report. | |
| setPaid ($id, $notrigger=0) | |
| Set to paid an expense report. | |
| cancel ($id, $detail, $notrigger=0) | |
| Cancel an expense report. | |
| getAllPayments ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0) | |
| Get the list of payments of an expense report. | |
| getPayments ($pid) | |
| Get an expense report payment. | |
| addPayment ($id, $request_data=null) | |
| Create a payment for an expense report. | |
| updatePayment ($id, $request_data=null) | |
| Update a payment of an expense report. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Delete paymentExpenseReport. | |
Protected Member Functions inherited from DolibarrApi | |
| _checkValForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _checkValExtrafieldsForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _filterObjectProperties ($object, $properties) | |
| Filter properties that will be returned on object. | |
| _checkFilters ($sqlfilters, &$error='') | |
| Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
| _validate ($data) | |
| Validate fields before create or update object. | |
| _validatepayment ($data) | |
| Validate fields before create or update object. | |
| _validateLine ($data) | |
| Validate fields before create or update object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
| Check access by user to a given resource. | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 38 of file api_expensereports.class.php.
|
protected |
Delete paymentExpenseReport.
| int | $id | ID of payment ExpenseReport |
@url DELETE {id}/payments Clean sensible object datas @phpstan-template T
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 1062 of file api_expensereports.class.php.
References $object.
Referenced by approve(), cancel(), deny(), get(), getAllPayments(), getLines(), getPayments(), index(), putLine(), setPaid(), setToDraft(), and validate().
|
private |
Validate fields before create or update object.
| ?array<string,string> | $data Array with data to verify |
| RestException |
Definition at line 1116 of file api_expensereports.class.php.
Referenced by post().
|
private |
Validate fields before create or update object.
| ?array<string,null|int|float|string> | $data Data to validate |
| RestException |
Definition at line 1161 of file api_expensereports.class.php.
Referenced by postLine().
|
private |
Validate fields before create or update object.
| ?array<string,string> | $data Array with data to verify |
| RestException |
Definition at line 1138 of file api_expensereports.class.php.
Referenced by addPayment().
| ExpenseReports::addPayment | ( | $id, | |
| $request_data = null ) |
Create a payment for an expense report.
| int | $id | ID of an expense report |
| array | $request_data | {@from body} Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST {id}/payments
| RestException |
Definition at line 948 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkValForAPI(), _validatepayment(), and isModEnabled().
| ExpenseReports::approve | ( | $id, | |
| $notrigger = 0 ) |
Approve an expense report.
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
| int | $id | Expense report ID |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/approve
| RestException |
Definition at line 688 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| ExpenseReports::cancel | ( | $id, | |
| $detail, | |||
| $notrigger = 0 ) |
Cancel an expense report.
| int | $id | ID of the expense report |
| string | $detail | Comments for cancellation |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/cancel
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 822 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and ExpenseReport\STATUS_CANCELED.
| ExpenseReports::delete | ( | $id | ) |
Delete expense report.
| int | $id | Expense Report ID |
| RestException |
Definition at line 557 of file api_expensereports.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| ExpenseReports::deleteLine | ( | $id, | |
| $lineid ) |
Delete a line from an expense report.
| int | $id | ID of the expense report to update |
| int | $lineid | ID of line to delete |
@url DELETE {id}/lines/{lineid}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 446 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and ExpenseReport\STATUS_DRAFT.
| ExpenseReports::deny | ( | $id, | |
| $details, | |||
| $notrigger = 0 ) |
Deny an expense report.
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
| int | $id | Expense report ID |
| string | $details | Comments for denial |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/deny
| RestException |
Definition at line 734 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| ExpenseReports::get | ( | $id | ) |
Get an expense report.
Return an array with Expense Report information
| int | $id | ID of Expense Report |
| RestException |
Definition at line 98 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| ExpenseReports::getAllPayments | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0 ) |
Get the list of payments of an expense report.
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | List limit |
| int | $page | Page number |
@url GET /payments
| RestException |
Definition at line 865 of file api_expensereports.class.php.
References _cleanObjectDatas(), and dol_syslog().
| ExpenseReports::getLines | ( | $id | ) |
Get lines of an expense report.
| int | $id | ID of the expense report |
@url GET {id}/lines
| RestException | 403 |
| RestException | 404 |
Definition at line 276 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| ExpenseReports::getPayments | ( | $pid | ) |
Get an expense report payment.
| int | $pid | Payment ID |
@url GET /payments/{pid}
| RestException |
Definition at line 919 of file api_expensereports.class.php.
References _cleanObjectDatas().
| ExpenseReports::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $user_ids = '', | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List expense reports.
Get a list of Expense Reports
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | List limit |
| int | $page | Page number |
| string | $user_ids | User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:>:'20160101')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
| RestException |
Definition at line 138 of file api_expensereports.class.php.
References _cleanObjectDatas(), and DolibarrApi\_filterObjectProperties().
| ExpenseReports::post | ( | $request_data = null | ) |
Create an expense report.
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException |
Definition at line 228 of file api_expensereports.class.php.
References DolibarrApi\_checkValForAPI(), _validate(), and sanitizeVal().
| ExpenseReports::postLine | ( | $id, | |
| $request_data = null ) |
Add a line to an expense report.
| int | $id | ID of the expense report to update |
| array | $request_data | Expense Report line data @phan-param ?array<string,mixed> $request_data @phpstan-param ?array<string,mixed> $request_data |
@url POST {id}/line
| RestException |
Definition at line 314 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _validateLine(), sanitizeVal(), and ExpenseReport\STATUS_DRAFT.
| ExpenseReports::put | ( | $id, | |
| $request_data = null ) |
Update expense report general fields.
Does not touch lines of the expense report
| int | $id | ID of Expense Report to update |
| array | $request_data | Expense report data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 401 Not allowed |
| RestException | 404 Expense report not found |
| RestException | 500 System error |
Definition at line 504 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValExtrafieldsForAPI(), DolibarrApi\_checkValForAPI(), and sanitizeVal().
| ExpenseReports::putLine | ( | $id, | |
| $lineid, | |||
| $request_data = null ) |
Update a line of an expense report.
| int | $id | ID of the expense report |
| int | $lineid | ID of the line to update |
| array | $request_data | Expense Report data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT {id}/lines/{lineid}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 378 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), sanitizeVal(), and ExpenseReport\STATUS_DRAFT.
| ExpenseReports::setPaid | ( | $id, | |
| $notrigger = 0 ) |
Set to paid an expense report.
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
| int | $id | Expense report ID |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/setpaid
| RestException |
Definition at line 780 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| ExpenseReports::setToDraft | ( | $id | ) |
Set an expense report to draft.
| int | $id | Expense report ID |
@url POST {id}/settodraft
| RestException | 304 |
| RestException | 403 |
| RestException | 404 |
Definition at line 599 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and ExpenseReport\STATUS_DRAFT.
| ExpenseReports::updatePayment | ( | $id, | |
| $request_data = null ) |
Update a payment of an expense report.
| int | $id | ID of paymentExpenseReport |
| array | $request_data | data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT {id}/payments
| RestException |
Definition at line 993 of file api_expensereports.class.php.
References $id, and DolibarrApi\_checkValForAPI().
| ExpenseReports::validate | ( | $id, | |
| $notrigger = 0 ) |
Validate an expense report.
If you get a bad value for param notrigger check, provide this in body { "notrigger": 0 }
| int | $id | Expense report ID |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/validate
| RestException |
Definition at line 643 of file api_expensereports.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().