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

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a commercial proposal object. More...
 
 post ($request_data=NULL)
 Create commercial proposal object. More...
 
 getLines ($id)
 Get lines of a commercial proposal. More...
 
 postLine ($id, $request_data=NULL)
 Add a line to given commercial proposal. More...
 
 putLine ($id, $lineid, $request_data=NULL)
 Update a line of given commercial proposal. More...
 
 deleteLine ($id, $lineid)
 Delete a line of given commercial proposal. More...
 
 put ($id, $request_data=NULL)
 Update commercial proposal general fields (won't touch lines of commercial proposal) More...
 
 delete ($id)
 Delete commercial proposal. More...
 
 settodraft ($id)
 Set a proposal to draft. More...
 
 validate ($id, $notrigger=0)
 Validate a commercial proposal. More...
 
 close ($id, $status, $note_private='', $notrigger=0)
 Close (Accept or refuse) a quote / commercial proposal. More...
 
 setinvoiced ($id)
 Set a commercial proposal billed. More...
 
 _validate ($data)
 Validate fields before create or update object. More...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. 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 30 of file api_proposals.class.php.

Member Function Documentation

Proposals::_cleanObjectDatas (   $object)

Clean sensible object datas.

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

Definition at line 707 of file api_proposals.class.php.

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

Proposals::_validate (   $data)

Validate fields before create or update object.

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

Definition at line 688 of file api_proposals.class.php.

Referenced by post().

Proposals::close (   $id,
  $status,
  $note_private = '',
  $notrigger = 0 
)

Close (Accept or refuse) a quote / commercial proposal.

Parameters
int$idCommercial proposal ID
int$statusMust be 2 (accepted) or 3 (refused) { 2}{ 3}
string$note_privateAdd this mention at end of private note
int$notriggerDisabled triggers

POST {id}/close

Returns
array

Definition at line 602 of file api_proposals.class.php.

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

Proposals::delete (   $id)

Delete commercial proposal.

Parameters
int$idCommercial proposal ID
Returns
array

Definition at line 461 of file api_proposals.class.php.

References DolibarrApi\_checkAccessToResource().

Proposals::deleteLine (   $id,
  $lineid 
)

Delete a line of given commercial proposal.

Parameters
int$idId of commercial proposal to update
int$lineidId of line to delete

DELETE {id}/lines/{lineid}

Returns
int
Exceptions
401
404

Definition at line 379 of file api_proposals.class.php.

References DolibarrApi\_checkAccessToResource().

Proposals::get (   $id)

Get properties of a commercial proposal object.

Return an array with commercial proposal informations

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

Definition at line 65 of file api_proposals.class.php.

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

Proposals::getLines (   $id)

Get lines of a commercial proposal.

Parameters
int$idId of commercial proposal

GET {id}/lines

Returns
int

Definition at line 213 of file api_proposals.class.php.

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

Proposals::post (   $request_data = NULL)

Create commercial proposal object.

Parameters
array$request_dataRequest data
Returns
int ID of proposal

Definition at line 179 of file api_proposals.class.php.

References _validate().

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

Add a line to given commercial proposal.

Parameters
int$idId of commercial proposal to update
array$request_dataCommercial proposal line data

POST {id}/lines

Returns
int

Definition at line 244 of file api_proposals.class.php.

References DolibarrApi\_checkAccessToResource().

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

Update commercial proposal general fields (won't touch lines of commercial proposal)

Parameters
int$idId of commercial proposal to update
array$request_dataDatas
Returns
int

Definition at line 413 of file api_proposals.class.php.

References DolibarrApi\_checkAccessToResource().

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

Update a line of given commercial proposal.

Parameters
int$idId of commercial proposal to update
int$lineidId of line to update
array$request_dataCommercial proposal line data

PUT {id}/lines/{lineid}

Returns
object

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

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

Proposals::setinvoiced (   $id)

Set a commercial proposal billed.

Could be also called setbilled

Parameters
int$idCommercial proposal ID

POST {id}/setinvoiced

Returns
array

Definition at line 647 of file api_proposals.class.php.

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

Proposals::settodraft (   $id)

Set a proposal to draft.

Parameters
int$idOrder ID

POST {id}/settodraft

Returns
array

Definition at line 497 of file api_proposals.class.php.

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

Proposals::validate (   $id,
  $notrigger = 0 
)

Validate a commercial proposal.

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

Parameters
int$idCommercial proposal ID
int$notrigger1=Does not execute triggers, 0= execute triggers

POST {id}/validate

Exceptions
304
401
404
500
Returns
array

Definition at line 554 of file api_proposals.class.php.

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


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