dolibarr 21.0.0-alpha
|
Public Member Functions | |
__construct () | |
Constructor. | |
get ($id, $contact_list=1) | |
Get properties of a commercial proposal object. | |
getByRef ($ref, $contact_list=1) | |
Get properties of an proposal object by ref. | |
getByRefExt ($ref_ext, $contact_list=1) | |
Get properties of an proposal object by ref_ext. | |
index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $thirdparty_ids='', $sqlfilters='', $properties='', $pagination_data=false) | |
List commercial proposals. | |
post ($request_data=null) | |
Create commercial proposal object. | |
getLines ($id, $sqlfilters='') | |
Get lines of a commercial proposal. | |
postLine ($id, $request_data=null) | |
Add a line to given commercial proposal. | |
postLines ($id, $request_data=null) | |
Add lines to given commercial proposal. | |
putLine ($id, $lineid, $request_data=null) | |
Update a line of given commercial proposal. | |
deleteLine ($id, $lineid) | |
Delete a line of given commercial proposal. | |
postContact ($id, $contactid, $type, $source='external') | |
Add a contact type of given commercial proposal. | |
deleteContact ($id, $contactid, $type) | |
Delete a contact type of given commercial proposal. | |
put ($id, $request_data=null) | |
Update commercial proposal general fields (won't touch lines of commercial proposal) | |
delete ($id) | |
Delete commercial proposal. | |
settodraft ($id) | |
Set a proposal to draft. | |
validate ($id, $notrigger=0) | |
Validate a commercial proposal. | |
close ($id, $status, $note_private='', $notrigger=0, $note_public='') | |
Close (Accept or refuse) a quote / commercial proposal. | |
setinvoiced ($id) | |
Set a commercial proposal billed. | |
Public Member Functions inherited from DolibarrApi | |
__construct ($db, $cachedir='', $refreshCache=false) | |
Constructor. | |
Protected Member Functions | |
_cleanObjectDatas ($object) | |
Clean sensible object datas. | |
Protected Member Functions inherited from DolibarrApi | |
_checkValForAPI ($field, $value, $object) | |
Check and convert a string depending on its type/name. | |
_filterObjectProperties ($object, $properties) | |
Filter properties that will be returned on object. | |
_checkFilters ($sqlfilters, &$error='') | |
Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
_fetch ($id, $ref='', $ref_ext='', $contact_list=1) | |
Get properties of an proposal object. | |
_validate ($data) | |
Validate fields before create or update object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
Check access by user to a given resource. | |
static | _forge_criteria_callback ($matches) |
Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 35 of file api_proposals.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 1008 of file api_proposals.class.php.
References $object.
Referenced by _fetch(), close(), deleteContact(), getLines(), index(), putLine(), setinvoiced(), settodraft(), and validate().
|
private |
Get properties of an proposal object.
Return an array with proposal information
int | $id | ID of order |
string | $ref | Ref of object |
string | $ref_ext | External reference of object |
int | $contact_list | 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id |
RestException |
Definition at line 124 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Referenced by get(), getByRef(), and getByRefExt().
|
private |
Validate fields before create or update object.
array | $data | Array with data to verify |
RestException |
Definition at line 988 of file api_proposals.class.php.
Referenced by post().
Proposals::close | ( | $id, | |
$status, | |||
$note_private = '', | |||
$notrigger = 0, | |||
$note_public = '' ) |
Close (Accept or refuse) a quote / commercial proposal.
int | $id | Commercial proposal ID |
int | $status | Must be 2 (accepted) or 3 (refused) {@min 2}{@max 3} |
string | $note_private | Add this mention at end of private note |
int | $notrigger | Disabled triggers |
string | $note_public | Add this mention at end of public note |
@url POST {id}/close
Definition at line 902 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Proposals::delete | ( | $id | ) |
Delete commercial proposal.
int | $id | Commercial proposal ID |
Definition at line 764 of file api_proposals.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
Proposals::deleteContact | ( | $id, | |
$contactid, | |||
$type ) |
Delete a contact type of given commercial proposal.
int | $id | Id of commercial proposal to update |
int | $contactid | Row key of the contact in the array contact_ids. |
string | $type | Type of the contact (BILLING, SHIPPING, CUSTOMER). |
@url DELETE {id}/contact/{contactid}/{type}
RestException | 401 |
RestException | 404 |
RestException | 500 System error |
Definition at line 670 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Proposals::deleteLine | ( | $id, | |
$lineid ) |
Delete a line of given commercial proposal.
int | $id | Id of commercial proposal to update |
int | $lineid | Id of line to delete |
@url DELETE {id}/lines/{lineid}
RestException | 401 |
RestException | 404 |
Definition at line 577 of file api_proposals.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
Proposals::get | ( | $id, | |
$contact_list = 1 ) |
Get properties of a commercial proposal object.
Return an array with commercial proposal information
int | $id | ID of commercial proposal |
int | $contact_list | 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id |
RestException |
Definition at line 70 of file api_proposals.class.php.
Proposals::getByRef | ( | $ref, | |
$contact_list = 1 ) |
Get properties of an proposal object by ref.
Return an array with proposal information
string | $ref | Ref of object |
int | $contact_list | 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id |
@url GET ref/{ref}
RestException |
Definition at line 88 of file api_proposals.class.php.
References _fetch().
Proposals::getByRefExt | ( | $ref_ext, | |
$contact_list = 1 ) |
Get properties of an proposal object by ref_ext.
Return an array with proposal information
string | $ref_ext | External reference of object |
int | $contact_list | 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id |
@url GET ref_ext/{ref_ext}
RestException |
Definition at line 106 of file api_proposals.class.php.
References _fetch().
Proposals::getLines | ( | $id, | |
$sqlfilters = '' ) |
Get lines of a commercial proposal.
int | $id | Id of commercial proposal |
string | $sqlfilters | Other criteria to filter answers separated by a comma. d is the alias for proposal lines table, p is the alias for product table. "Syntax example "(p.ref:like:'SO-') AND (d.date_start:<:'20220101')" |
@url GET {id}/lines
Definition at line 310 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and forgeSQLFromUniversalSearchCriteria().
Proposals::index | ( | $sortfield = "t.rowid", | |
$sortorder = 'ASC', | |||
$limit = 100, | |||
$page = 0, | |||
$thirdparty_ids = '', | |||
$sqlfilters = '', | |||
$properties = '', | |||
$pagination_data = false ) |
List commercial proposals.
Get a list of commercial proposals
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
string | $thirdparty_ids | Thirdparty ids to filter commercial proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'2016-01-01')" |
string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
Definition at line 165 of file api_proposals.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
Proposals::post | ( | $request_data = null | ) |
Create commercial proposal object.
array | $request_data | Request data |
Definition at line 269 of file api_proposals.class.php.
References DolibarrApi\_checkValForAPI(), _validate(), and sanitizeVal().
Proposals::postContact | ( | $id, | |
$contactid, | |||
$type, | |||
$source = 'external' ) |
Add a contact type of given commercial proposal.
int | $id | Id of commercial proposal to update |
int | $contactid | Id of external or internal contact to add |
string | $type | Type of the external contact (BILLING, SHIPPING, CUSTOMER), internal contact (SALESREPFOLL) |
string | $source | Source of the contact (internal, external) |
@url POST {id}/contact/{contactid}/{type}/{source}
RestException | 401 |
RestException | 404 |
Definition at line 614 of file api_proposals.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
Proposals::postLine | ( | $id, | |
$request_data = null ) |
Add a line to given commercial proposal.
int | $id | Id of commercial proposal to update |
array | $request_data | Commercial proposal line data |
@url POST {id}/line
Definition at line 352 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and sanitizeVal().
Proposals::postLines | ( | $id, | |
$request_data = null ) |
Add lines to given commercial proposal.
int | $id | Id of commercial proposal to update |
array | $request_data | Commercial proposal line data |
@url POST {id}/lines
Definition at line 418 of file api_proposals.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
Proposals::put | ( | $id, | |
$request_data = null ) |
Update commercial proposal general fields (won't touch lines of commercial proposal)
int | $id | Id of commercial proposal to update |
array | $request_data | Datas |
Definition at line 708 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), and sanitizeVal().
Proposals::putLine | ( | $id, | |
$lineid, | |||
$request_data = null ) |
Update a line of given commercial proposal.
int | $id | Id of commercial proposal to update |
int | $lineid | Id of line to update |
array | $request_data | Commercial proposal line data |
@url PUT {id}/lines/{lineid}
Definition at line 499 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and sanitizeVal().
Proposals::setinvoiced | ( | $id | ) |
Set a commercial proposal billed.
Could be also called setbilled
int | $id | Commercial proposal ID |
@url POST {id}/setinvoiced
Definition at line 946 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Proposals::settodraft | ( | $id | ) |
Set a proposal to draft.
int | $id | Order ID |
@url POST {id}/settodraft
Definition at line 798 of file api_proposals.class.php.
References $id, 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 }
int | $id | Commercial proposal ID |
int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/validate
RestException | 304 |
RestException | 401 |
RestException | 404 |
RestException | 500 System error |
Definition at line 854 of file api_proposals.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().