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

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of an order object. More...
 
 post ($request_data=NULL)
 Create order object. More...
 
 getLines ($id)
 Get lines of an order. More...
 
 postLine ($id, $request_data=NULL)
 Add a line to given order. More...
 
 putLine ($id, $lineid, $request_data=NULL)
 Update a line to given order. More...
 
 deleteLine ($id, $lineid)
 Delete a line to given order. More...
 
 put ($id, $request_data=NULL)
 Update order general fields (won't touch lines of order) More...
 
 delete ($id)
 Delete order. More...
 
 validate ($id, $idwarehouse=0, $notrigger=0)
 Validate an order. More...
 
 reopen ($id)
 Tag the order as validated (opened) More...
 
 setinvoiced ($id)
 Classify the order as invoiced. More...
 
 close ($id, $notrigger=0)
 Close an order (Classify it as "Delivered") More...
 
 settodraft ($id, $idwarehouse=-1)
 Set an order to draft. More...
 
 createOrderFromProposal ($proposalid)
 Create an order using an existing proposal. 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 29 of file api_orders.class.php.

Member Function Documentation

Orders::_cleanObjectDatas (   $object)

Clean sensible object datas.

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

Definition at line 765 of file api_orders.class.php.

Referenced by close(), createOrderFromProposal(), get(), getLines(), putLine(), setinvoiced(), settodraft(), and validate().

Orders::_validate (   $data)

Validate fields before create or update object.

Parameters
array$dataArray with data to verify
Returns
array
Exceptions
RestException

Definition at line 786 of file api_orders.class.php.

Referenced by post().

Orders::close (   $id,
  $notrigger = 0 
)

Close an order (Classify it as "Delivered")

Parameters
int$idOrder ID
int$notriggerDisabled triggers

POST {id}/close

Returns
int

Definition at line 632 of file api_orders.class.php.

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

Orders::createOrderFromProposal (   $proposalid)

Create an order using an existing proposal.

Parameters
int$proposalidId of the proposal

POST /createfromproposal/{proposalid}

Returns
int
Exceptions
400
401
404
405

Definition at line 729 of file api_orders.class.php.

References _cleanObjectDatas().

Orders::delete (   $id)

Delete order.

Parameters
int$idOrder ID
Returns
array

Definition at line 452 of file api_orders.class.php.

References DolibarrApi\_checkAccessToResource().

Orders::deleteLine (   $id,
  $lineid 
)

Delete a line to given order.

Parameters
int$idId of order to update
int$lineidId of line to delete

DELETE {id}/lines/{lineid}

Returns
int
Exceptions
401
404

Definition at line 370 of file api_orders.class.php.

References DolibarrApi\_checkAccessToResource().

Orders::get (   $id)

Get properties of an order object.

Return an array with order informations

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

Definition at line 64 of file api_orders.class.php.

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

Orders::getLines (   $id)

Get lines of an order.

Parameters
int$idId of order

GET {id}/lines

Returns
int

Definition at line 216 of file api_orders.class.php.

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

Orders::post (   $request_data = NULL)

Create order object.

Parameters
array$request_dataRequest data
Returns
int ID of order

Definition at line 181 of file api_orders.class.php.

References _validate().

Orders::postLine (   $id,
  $request_data = NULL 
)

Add a line to given order.

Parameters
int$idId of order to update
array$request_dataOrderLine data

POST {id}/lines

Returns
int

Definition at line 247 of file api_orders.class.php.

References DolibarrApi\_checkAccessToResource().

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

Update order general fields (won't touch lines of order)

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

Definition at line 404 of file api_orders.class.php.

References DolibarrApi\_checkAccessToResource().

Orders::putLine (   $id,
  $lineid,
  $request_data = NULL 
)

Update a line to given order.

Parameters
int$idId of order to update
int$lineidId of line to update
array$request_dataOrderLine data

PUT {id}/lines/{lineid}

Returns
object

Definition at line 310 of file api_orders.class.php.

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

Orders::reopen (   $id)

Tag the order as validated (opened)

Function used when order is reopend after being closed.

Parameters
int$idId of the order

POST {id}/reopen

Returns
int
Exceptions
304
400
401
404
405

Definition at line 553 of file api_orders.class.php.

Orders::setinvoiced (   $id)

Classify the order as invoiced.

Could be also called setbilled

Parameters
int$idId of the order

POST {id}/setinvoiced

Returns
int
Exceptions
400
401
404
405

Definition at line 590 of file api_orders.class.php.

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

Orders::settodraft (   $id,
  $idwarehouse = -1 
)

Set an order to draft.

Parameters
int$idOrder ID
int$idwarehouseWarehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on)

POST {id}/settodraft

Returns
array

Definition at line 678 of file api_orders.class.php.

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

Orders::validate (   $id,
  $idwarehouse = 0,
  $notrigger = 0 
)

Validate an order.

If you get a bad value for param notrigger check that ou provide this in body { "idwarehouse": 0, "notrigger": 0 }

Parameters
int$idOrder ID
int$idwarehouseWarehouse ID
int$notrigger1=Does not execute triggers, 0= execute triggers

POST {id}/validate

Exceptions
304
401
404
500
Returns
array

Definition at line 501 of file api_orders.class.php.

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


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