dolibarr  7.0.0-beta
Public Member Functions | List of all members
Thirdparties Class Reference
+ Inheritance diagram for Thirdparties:
+ Collaboration diagram for Thirdparties:

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a thirdparty object. More...
 
 index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $mode=0, $sqlfilters= '')
 List thirdparties. More...
 
 post ($request_data=NULL)
 Create thirdparty object. More...
 
 put ($id, $request_data=NULL)
 Update thirdparty. More...
 
 delete ($id)
 Delete thirdparty. More...
 
 getCategories ($id, $sortfield="s.rowid", $sortorder= 'ASC', $limit=0, $page=0)
 Get categories for a thirdparty. More...
 
 addCategory ($id, $request_data=NULL)
 Add category to a thirdparty. More...
 
 getFixedAmountDiscounts ($id, $filter="none", $sortfield="f.type", $sortorder= 'ASC')
 Get fixed amount discount of a thirdparty (all sources: deposit, credit note, commercial offers...) More...
 
 getInvoicesQualifiedForReplacement ($id)
 Return list of invoices qualified to be replaced by another invoice. More...
 
 getInvoicesQualifiedForCreditNote ($id)
 Return list of invoices qualified to be corrected by a credit note. More...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
 _validate ($data)
 Validate fields before create or update object. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 
 _cleanObjectDatas ($object)
 Executed method when API is called without parameter. More...
 
 _checkFilters ($sqlfilters)
 Return if a $sqlfilters parameter is valid. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DolibarrApi
static _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
 Check user access to a resource. More...
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria. More...
 

Detailed Description

Definition at line 28 of file api_thirdparties.class.php.

Member Function Documentation

Thirdparties::_cleanObjectDatas (   $object)

Clean sensible object datas.

Parameters
object$objectObject to clean
Returns
array Array of cleaned object properties

Definition at line 493 of file api_thirdparties.class.php.

Referenced by get(), and index().

Thirdparties::_validate (   $data)

Validate fields before create or update object.

Parameters
array$dataDatas to validate
Returns
array
Exceptions
RestException

Definition at line 519 of file api_thirdparties.class.php.

Referenced by post().

Thirdparties::addCategory (   $id,
  $request_data = NULL 
)

Add category to a thirdparty.

Parameters
int$idId of thirdparty
array$request_dataRequest datas
Returns
mixed

POST {id}/addCategory

Definition at line 311 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource().

Thirdparties::delete (   $id)

Delete thirdparty.

Parameters
int$idThirparty ID
Returns
integer

Definition at line 252 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource().

Thirdparties::get (   $id)

Get properties of a thirdparty object.

Return an array with thirdparty informations

Parameters
int$idID of thirdparty
Returns
array|mixed data without useless information
Exceptions
RestException

Definition at line 71 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and price2num().

Thirdparties::getCategories (   $id,
  $sortfield = "s.rowid",
  $sortorder = 'ASC',
  $limit = 0,
  $page = 0 
)

Get categories for a thirdparty.

Parameters
int$idID of thirdparty
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
Returns
mixed

GET {id}/categories

Definition at line 280 of file api_thirdparties.class.php.

Thirdparties::getFixedAmountDiscounts (   $id,
  $filter = "none",
  $sortfield = "f.type",
  $sortorder = 'ASC' 
)

Get fixed amount discount of a thirdparty (all sources: deposit, credit note, commercial offers...)

Parameters
int$idID of the thirdparty
string$filterFilter exceptional discount. "none" will return every discount, "available" returns unapplied discounts, "used" returns applied discounts { none,available,used}
string$sortfieldSort field
string$sortorderSort order

GET {id}/fixedamountdiscounts

Returns
array List of fixed discount of thirdparty
Exceptions
400
401
404
503

Definition at line 359 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource().

Thirdparties::getInvoicesQualifiedForCreditNote (   $id)

Return list of invoices qualified to be corrected by a credit note.

Invoices matching the following rules are returned (validated + payment on process) or classified (payed completely or payed partialy) + not already replaced + not already a credit note

Parameters
int$idId of thirdparty

GET {id}/getinvoicesqualifiedforcreditnote

Returns
array
Exceptions
400
401
404
405

Definition at line 459 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource().

Thirdparties::getInvoicesQualifiedForReplacement (   $id)

Return list of invoices qualified to be replaced by another invoice.

Parameters
int$idId of thirdparty

GET {id}/getinvoicesqualifiedforreplacement

Returns
array
Exceptions
400
401
404
405

Definition at line 417 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource().

Thirdparties::index (   $sortfield = "t.rowid",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $mode = 0,
  $sqlfilters = '' 
)

List thirdparties.

Get a list of thirdparties

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
int$modeSet to 1 to show only customers Set to 2 to show only prospects Set to 3 to show only those are not customer neither prospect
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.nom:like:'TheCompany%') and (t.date_creation:<:'20160101')"
Returns
array Array of thirdparty objects

Definition at line 111 of file api_thirdparties.class.php.

References DolibarrApi\_checkFilters(), and _cleanObjectDatas().

Thirdparties::post (   $request_data = NULL)

Create thirdparty object.

Parameters
array$request_dataRequest datas
Returns
int ID of thirdparty

Definition at line 196 of file api_thirdparties.class.php.

References _validate().

Thirdparties::put (   $id,
  $request_data = NULL 
)

Update thirdparty.

Parameters
int$idId of thirdparty to update
array$request_dataDatas
Returns
int

Definition at line 220 of file api_thirdparties.class.php.

References DolibarrApi\_checkAccessToResource().


The documentation for this class was generated from the following file: