Proposals
class Proposals extends DolibarrApi (View source)
API class for orders
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| Propal | $propal |
Methods
Constructor
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensible object datas
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Get a commercial proposal
Get a commercial proposal by ref
Get a commercial proposal by ref_ext
List commercial proposals
Create a commercial proposal
Get lines of a commercial proposal
Add a line to a commercial proposal
Add lines to a commercial proposal
Update a line of a commercial proposal
Delete a line of a commercial proposal
Get contacts of given proposal
Add (link) a contact to a commercial proposal
Remove (unlink) a contact from commercial proposal
Update a commercial proposal general fields (won't change lines of commercial proposal)
Delete a commercial proposal
Set a commercial proposal to draft
Validate a commercial proposal
Close (accept or refuse) a commercial proposal
Set a commercial proposal to billed
Details
__construct()
Constructor
protected string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)
Check and convert a string depending on its type/name.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensible object datas
static protected bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')
Check access by user to a given resource
protected bool|string
_checkFilters(string $sqlfilters, string $error = '')
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
static protected string
_forge_criteria_callback(string[] $matches)
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
object
get(int $id, int $contact_list = 1)
Get a commercial proposal
Return an array with commercial proposal information
object
getByRef(string $ref, int $contact_list = 1)
Get a commercial proposal by ref
Return an array with proposal information
object
getByRefExt(string $ref_ext, int $contact_list = 1)
Get a commercial proposal by ref_ext
Return an array with proposal information
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $thirdparty_ids = '', string $sqlfilters = '', string $properties = '', bool $pagination_data = false, int $loadlinkedobjects = 0)
List commercial proposals
Get a list of commercial proposals
int
post(array $request_data = null)
Create a commercial proposal
array
getLines(int $id, string $sqlfilters = '')
Get lines of a commercial proposal
int
postLine(int $id, array $request_data = null)
Add a line to a commercial proposal
int
postLines(int $id, array $request_data = null)
Add lines to a commercial proposal
object|false
putLine(int $id, int $lineid, array $request_data = null)
Update a line of a commercial proposal
object|false
deleteLine(int $id, int $lineid)
Delete a line of a commercial proposal
array<int, mixed>
getContacts(int $id, string $type = '')
Get contacts of given proposal
Return an array with contact information
array
postContact(int $id, int $contactid, string $type, string $source = 'external', int $notrigger = 0)
Add (link) a contact to a commercial proposal
object
deleteContact(int $id, int $contactid, string $type)
Remove (unlink) a contact from commercial proposal
object
put(int $id, array $request_data = null)
Update a commercial proposal general fields (won't change lines of commercial proposal)
array
delete(int $id)
Delete a commercial proposal
object
settodraft(int $id)
Set a commercial proposal to draft
object
validate(int $id, int $notrigger = 0)
Validate a commercial proposal
If you get a bad value for param notrigger check that ou provide this in body { "notrigger": 0 }
object
close(int $id, int $status, string $note_private = '', int $notrigger = 0, string $note_public = '')
Close (accept or refuse) a commercial proposal
object
setinvoiced(int $id)
Set a commercial proposal to billed