|
| __construct () |
| Constructor.
|
|
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $category=0, $sqlfilters='') |
| Get the list of accounts. More...
|
|
| get ($id) |
| Get account by ID. More...
|
|
| post ($request_data=null) |
| Create account object. More...
|
|
| 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. More...
|
|
| put ($id, $request_data=null) |
| Update account. More...
|
|
| delete ($id) |
| Delete account. More...
|
|
| getLines ($id, $sqlfilters='') |
| Get the list of lines of the account. More...
|
|
| 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. More...
|
|
| addLink ($id, $line_id, $url_id, $url, $label, $type) |
| Add a link to an account line. More...
|
|
| __construct ($db, $cachedir='', $refreshCache=false) |
| Constructor. More...
|
|
|
static | $FIELDS |
| array $FIELDS Mandatory fields, checked when creating an object
|
|
Definition at line 30 of file api_bankaccounts.class.php.
◆ _cleanObjectDatas()
BankAccounts::_cleanObjectDatas |
( |
|
$object | ) |
|
|
protected |
Clean sensible object datas.
- Parameters
-
Object | $object | Object to clean |
- Returns
- Object Object with cleaned properties
Reimplemented from DolibarrApi.
Definition at line 402 of file api_bankaccounts.class.php.
◆ _validate()
BankAccounts::_validate |
( |
|
$data | ) |
|
|
private |
◆ addLine()
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.
- Parameters
-
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} |
- Returns
- int ID of line
@url POST {id}/lines
Definition at line 489 of file api_bankaccounts.class.php.
◆ addLink()
BankAccounts::addLink |
( |
|
$id, |
|
|
|
$line_id, |
|
|
|
$url_id, |
|
|
|
$url, |
|
|
|
$label, |
|
|
|
$type |
|
) |
| |
Add a link to an account line.
- Parameters
-
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} |
- Returns
- int ID of link
@url POST {id}/lines/{line_id}/links
Definition at line 542 of file api_bankaccounts.class.php.
◆ delete()
BankAccounts::delete |
( |
|
$id | ) |
|
◆ get()
◆ getLines()
BankAccounts::getLines |
( |
|
$id, |
|
|
|
$sqlfilters = '' |
|
) |
| |
Get the list of lines of the account.
- Parameters
-
- Returns
- array Array of AccountLine objects
- Exceptions
-
RestException | @url GET {id}/lines |
- Parameters
-
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 423 of file api_bankaccounts.class.php.
◆ index()
BankAccounts::index |
( |
|
$sortfield = "t.rowid" , |
|
|
|
$sortorder = 'ASC' , |
|
|
|
$limit = 100 , |
|
|
|
$page = 0 , |
|
|
|
$category = 0 , |
|
|
|
$sqlfilters = '' |
|
) |
| |
Get the list of accounts.
- Parameters
-
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')" |
- Returns
- array List of account objects
- Exceptions
-
Definition at line 65 of file api_bankaccounts.class.php.
◆ post()
BankAccounts::post |
( |
|
$request_data = null | ) |
|
Create account object.
- Parameters
-
array | $request_data | Request data |
- Returns
- int ID of account
Definition at line 151 of file api_bankaccounts.class.php.
◆ put()
BankAccounts::put |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Update account.
- Parameters
-
int | $id | ID of account |
array | $request_data | data |
- Returns
- Object Object with cleaned properties
Definition at line 320 of file api_bankaccounts.class.php.
◆ transfer()
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.
- Parameters
-
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
- Returns
- array
@status 201
- Exceptions
-
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 196 of file api_bankaccounts.class.php.
The documentation for this class was generated from the following file: