dolibarr 19.0.3
|
Public Member Functions | |
__construct () | |
Constructor. | |
index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $category=0, $sqlfilters='', $properties='') | |
Get the list of accounts. | |
get ($id) | |
Get account by ID. | |
post ($request_data=null) | |
Create account object. | |
transfer ($bankaccount_from_id=0, $bankaccount_to_id=0, $date=null, $description="", $amount=0.0, $amount_to=0.0) | |
Create an internal wire transfer between two bank accounts. | |
put ($id, $request_data=null) | |
Update account. | |
delete ($id) | |
Delete account. | |
getLines ($id, $sqlfilters='') | |
Get the list of lines of the account. | |
addLine ($id, $date, $type, $label, $amount, $category=0, $cheque_number='', $cheque_writer='', $cheque_bank='', $accountancycode='', $datev=null, $num_releve='') | |
Add a line to an account. | |
addLink ($id, $line_id, $url_id, $url, $label, $type) | |
Add a link to an account line. | |
getLinks ($id, $line_id) | |
Get the list of links for a line of the account. | |
Public Member Functions inherited from DolibarrApi | |
__construct ($db, $cachedir='', $refreshCache=false) | |
Constructor. | |
Static Public Attributes | |
static | $FIELDS |
array $FIELDS Mandatory fields, checked when creating an object | |
Protected Member Functions | |
_cleanObjectDatas ($object) | |
Clean sensible object datas. | |
Protected Member Functions inherited from DolibarrApi | |
_checkValForAPI ($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 creating an 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 30 of file api_bankaccounts.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 414 of file api_bankaccounts.class.php.
Referenced by get(), getLines(), and index().
|
private |
Validate fields before creating an object.
array | null | $data | Data to validate |
RestException |
Definition at line 395 of file api_bankaccounts.class.php.
References $FIELDS.
Referenced by post().
BankAccounts::addLine | ( | $id, | |
$date, | |||
$type, | |||
$label, | |||
$amount, | |||
$category = 0, | |||
$cheque_number = '', | |||
$cheque_writer = '', | |||
$cheque_bank = '', | |||
$accountancycode = '', | |||
$datev = null, | |||
$num_releve = '' ) |
Add a line to an account.
int | $id | ID of account |
string | $date | Payment date (timestamp) {@from body} {@type timestamp} |
string | $type | Payment mode (TYP,VIR,PRE,LIQ,VAD,CB,CHQ...) {@from body} |
string | $label | Label {@from body} |
float | $amount | Amount (may be 0) {@from body} |
int | $category | Category |
string | $cheque_number | Cheque numero {@from body} |
string | $cheque_writer | Name of cheque writer {@from body} |
string | $cheque_bank | Bank of cheque writer {@from body} |
string | $accountancycode | Accountancy code {@from body} |
string | $datev | Payment date value (timestamp) {@from body} {@type timestamp} |
string | $num_releve | Bank statement numero {@from body} |
@url POST {id}/lines
Definition at line 500 of file api_bankaccounts.class.php.
References sanitizeVal().
BankAccounts::addLink | ( | $id, | |
$line_id, | |||
$url_id, | |||
$url, | |||
$label, | |||
$type ) |
Add a link to an account line.
int | $id | ID of account |
int | $line_id | ID of account line |
int | $url_id | ID to set in the URL {@from body} |
string | $url | URL of the link {@from body} |
string | $label | Label {@from body} |
string | $type | Type of link ('payment', 'company', 'member', ...) {@from body} |
@url POST {id}/lines/{line_id}/links
Definition at line 553 of file api_bankaccounts.class.php.
References sanitizeVal().
BankAccounts::delete | ( | $id | ) |
Delete account.
int | $id | ID of account |
Definition at line 364 of file api_bankaccounts.class.php.
BankAccounts::get | ( | $id | ) |
Get account by ID.
int | $id | ID of account |
RestException |
Definition at line 130 of file api_bankaccounts.class.php.
References _cleanObjectDatas().
BankAccounts::getLines | ( | $id, | |
$sqlfilters = '' ) |
Get the list of lines of the account.
int | $id | ID of account |
RestException |
@url GET {id}/lines
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')" |
Definition at line 435 of file api_bankaccounts.class.php.
References _cleanObjectDatas(), and forgeSQLFromUniversalSearchCriteria().
BankAccounts::getLinks | ( | $id, | |
$line_id ) |
Get the list of links for a line of the account.
int | $id | ID of account |
int | $line_id | ID of account line |
RestException |
@url GET {id}/lines/{line_id}/links
Definition at line 594 of file api_bankaccounts.class.php.
BankAccounts::index | ( | $sortfield = "t.rowid", | |
$sortorder = 'ASC', | |||
$limit = 100, | |||
$page = 0, | |||
$category = 0, | |||
$sqlfilters = '', | |||
$properties = '' ) |
Get the list of accounts.
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
int | $category | Use this param to filter list by category |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')" |
string | $properties | Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names |
RestException |
Definition at line 66 of file api_bankaccounts.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
BankAccounts::post | ( | $request_data = null | ) |
Create account object.
array | $request_data | Request data |
Definition at line 151 of file api_bankaccounts.class.php.
References DolibarrApi\_checkValForAPI(), and _validate().
BankAccounts::put | ( | $id, | |
$request_data = null ) |
Update account.
int | $id | ID of account |
array | $request_data | data |
Definition at line 326 of file api_bankaccounts.class.php.
References DolibarrApi\_checkValForAPI().
BankAccounts::transfer | ( | $bankaccount_from_id = 0, | |
$bankaccount_to_id = 0, | |||
$date = null, | |||
$description = "", | |||
$amount = 0.0, | |||
$amount_to = 0.0 ) |
Create an internal wire transfer between two bank accounts.
int | $bankaccount_from_id | BankAccount ID to use as the source of the internal wire transfer {@from body}{@required true} |
int | $bankaccount_to_id | BankAccount ID to use as the destination of the internal wire transfer {@from body}{@required true} |
string | $date | Date of the internal wire transfer (UNIX timestamp) {@from body}{@required true}{@type timestamp} |
string | $description | Description of the internal wire transfer {@from body}{@required true} |
float | $amount | Amount to transfer from the source to the destination BankAccount {@from body}{@required true} |
float | $amount_to | Amount to transfer to the destination BankAccount (only when accounts does not share the same currency) {@from body}{@required false} |
@url POST /transfer
@status 201
RestException | 401 Unauthorized: User does not have permission to configure bank accounts |
RestException | 404 Not Found: Either the source or the destination bankaccount for the provided id does not exist |
RestException | 422 Unprocessable Entity: Refer to detailed exception message for the cause |
RestException | 500 Internal Server Error: Error(s) returned by the RDBMS |
Creating bank line records
Creating links between bank line record and its source
Definition at line 202 of file api_bankaccounts.class.php.
References price2num(), sanitizeVal(), and Account\TYPE_CASH.