BankAccounts
class BankAccounts extends DolibarrApi (View source)
API class for accounts
Properties
| DoliDB | $db | ||
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS |
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 the list of accounts.
Get account by ID.
Create account object
Create an internal wire transfer between two bank accounts
Update account
Delete account
Get the list of lines of the account.
Add a line to an account
Add a link to an account line
Get the list of links for a line of the account.
Get the detail of a given line of the bank account.
Update an account line
Delete an account line
Get the current account balance
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
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $category = 0, string $sqlfilters = '', string $properties = '')
Get the list of accounts.
object
get(int $id)
Get account by ID.
int
post(array $request_data = null)
Create account object
array
transfer(int $bankaccount_from_id = 0, int $bankaccount_to_id = 0, string $date = null, string $description = "", float $amount = 0.0, float $amount_to = 0.0, string $cheque_number = "")
Create an internal wire transfer between two bank accounts
object
put(int $id, array $request_data = null)
Update account
array
delete(int $id)
Delete account
array
getLines(int $id, string $sqlfilters = '')
Get the list of lines of the account.
int
addLine(int $id, string $date, string $type, string $label, float $amount, int $category = 0, string $cheque_number = '', string $cheque_writer = '', string $cheque_bank = '', string $accountancycode = '', string $datev = null, string $num_releve = '')
Add a line to an account
int
addLink(int $id, int $line_id, int $url_id, string $url, string $label, string $type)
Add a link to an account line
array
getLinks(int $id, int $line_id)
Get the list of links for a line of the account.
array|mixed
getDetailAccountLine(int $line_id)
Get the detail of a given line of the bank account.
int
updateLine(int $id, int $line_id, string $label)
Update an account line
array
deleteLine(int $id, int $line_id)
Delete an account line
float
getBalance(int $id)
Get the current account balance