dolibarr
x.y.z
|
Public Member Functions | |
__construct () | |
Constructor. | |
get ($id, $contact_list=1) | |
Get properties of a commercial proposal object. More... | |
getByRef ($ref, $contact_list=1) | |
Get properties of an proposal object by ref. More... | |
getByRefExt ($ref_ext, $contact_list=1) | |
Get properties of an proposal object by ref_ext. More... | |
index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $thirdparty_ids='', $sqlfilters='') | |
List commercial proposals. More... | |
post ($request_data=null) | |
Create commercial proposal object. More... | |
getLines ($id, $sqlfilters='') | |
Get lines of a commercial proposal. More... | |
postLine ($id, $request_data=null) | |
Add a line to given commercial proposal. More... | |
postLines ($id, $request_data=null) | |
Add lines 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... | |
postContact ($id, $contactid, $type) | |
Add a contact type of given commercial proposal. More... | |
deleteContact ($id, $contactid, $type) | |
Delete a contact type 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... | |
Public Member Functions inherited from DolibarrApi | |
__construct ($db, $cachedir='', $refreshCache=false) | |
Constructor. More... | |
Protected Member Functions | |
_cleanObjectDatas ($object) | |
Clean sensible object datas. More... | |
Protected Member Functions inherited from DolibarrApi | |
_checkValForAPI ($field, $value, $object) | |
Check and convert a string depending on its type/name. More... | |
_checkFilters ($sqlfilters, &$error='') | |
Return if a $sqlfilters parameter is valid. More... | |
Private Member Functions | |
_fetch ($id, $ref='', $ref_ext='', $contact_list=1) | |
Get properties of an proposal object. More... | |
_validate ($data) | |
Validate fields before create or update object. More... | |
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. More... | |
static | _forge_criteria_callback ($matches) |
Function to forge a SQL criteria from a Generic filter string. More... | |
Definition at line 33 of file api_proposals.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 968 of file api_proposals.class.php.
|
private |
Get properties of an proposal object.
Return an array with proposal informations
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 122 of file api_proposals.class.php.
Referenced by getByRefExt().
|
private |
Validate fields before create or update object.
array | $data | Array with data to verify |
RestException |
Definition at line 948 of file api_proposals.class.php.
Proposals::close | ( | $id, | |
$status, | |||
$note_private = '' , |
|||
$notrigger = 0 |
|||
) |
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 |
@url POST {id}/close
Definition at line 862 of file api_proposals.class.php.
Proposals::delete | ( | $id | ) |
Delete commercial proposal.
int | $id | Commercial proposal ID |
Definition at line 725 of file api_proposals.class.php.
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 643 of file api_proposals.class.php.
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 559 of file api_proposals.class.php.
Proposals::get | ( | $id, | |
$contact_list = 1 |
|||
) |
Get properties of a commercial proposal object.
Return an array with commercial proposal informations
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 68 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 informations
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 86 of file api_proposals.class.php.
Proposals::getByRefExt | ( | $ref_ext, | |
$contact_list = 1 |
|||
) |
Get properties of an proposal object by ref_ext.
Return an array with proposal informations
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 104 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 294 of file api_proposals.class.php.
Proposals::index | ( | $sortfield = "t.rowid" , |
|
$sortorder = 'ASC' , |
|||
$limit = 100 , |
|||
$page = 0 , |
|||
$thirdparty_ids = '' , |
|||
$sqlfilters = '' |
|||
) |
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:<:'20160101')" |
Definition at line 161 of file api_proposals.class.php.
Proposals::post | ( | $request_data = null | ) |
Create commercial proposal object.
array | $request_data | Request data |
Definition at line 259 of file api_proposals.class.php.
Proposals::postContact | ( | $id, | |
$contactid, | |||
$type | |||
) |
Add a contact type of given commercial proposal.
int | $id | Id of commercial proposal to update |
int | $contactid | Id of contact to add |
string | $type | Type of the contact (BILLING, SHIPPING, CUSTOMER) |
@url POST {id}/contact/{contactid}/{type}
RestException | 401 |
RestException | 404 |
Definition at line 595 of file api_proposals.class.php.
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 337 of file api_proposals.class.php.
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 403 of file api_proposals.class.php.
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 681 of file api_proposals.class.php.
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 481 of file api_proposals.class.php.
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 906 of file api_proposals.class.php.
Proposals::settodraft | ( | $id | ) |
Set a proposal to draft.
int | $id | Order ID |
@url POST {id}/settodraft
Definition at line 759 of file api_proposals.class.php.
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 815 of file api_proposals.class.php.