dolibarr 18.0.6
|
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='') | |
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) | |
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) | |
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. | |
_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 33 of file api_proposals.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 967 of file api_proposals.class.php.
Referenced by _fetch(), close(), deleteContact(), getLines(), index(), putLine(), setinvoiced(), settodraft(), and validate().
|
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.
References 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 947 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.
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 861 of file api_proposals.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Proposals::delete | ( | $id | ) |
Delete commercial proposal.
int | $id | Commercial proposal ID |
Definition at line 724 of file api_proposals.class.php.
References 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 642 of file api_proposals.class.php.
References 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 558 of file api_proposals.class.php.
References DolibarrApi\_checkAccessToResource().
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.
References _fetch().
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.
References _fetch().
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.
References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and forgeSQLFromUniversalSearchCriteria().
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.
References _cleanObjectDatas(), dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
Proposals::post | ( | $request_data = null | ) |
Create commercial proposal object.
array | $request_data | Request data |
Definition at line 259 of file api_proposals.class.php.
References _validate().
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 594 of file api_proposals.class.php.
References 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 336 of file api_proposals.class.php.
References 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 402 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)
int | $id | Id of commercial proposal to update |
array | $request_data | Datas |
Definition at line 680 of file api_proposals.class.php.
References DolibarrApi\_checkAccessToResource().
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 480 of file api_proposals.class.php.
References 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 905 of file api_proposals.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Proposals::settodraft | ( | $id | ) |
Set a proposal to draft.
int | $id | Order ID |
@url POST {id}/settodraft
Definition at line 758 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 }
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 814 of file api_proposals.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().