|
dolibarr 19.0.4
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get properties of a MO object. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='') | |
| List Mos. | |
| post ($request_data=null) | |
| Create MO object. | |
| put ($id, $request_data=null) | |
| Update MO. | |
| delete ($id) | |
| Delete MO. | |
| produceAndConsumeAll ($id, $request_data=null) | |
| Produce and consume all. | |
| produceAndConsume ($id, $request_data=null) | |
| Produce and consume. | |
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 | |
| _validate ($data) | |
| Validate fields before create or update object. | |
| checkRefNumbering () | |
| Validate the ref field and get the next Number if it's necessary. | |
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 36 of file api_mos.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 923 of file api_mos.class.php.
References _cleanObjectDatas().
Referenced by _cleanObjectDatas(), get(), and index().
|
private |
Validate fields before create or update object.
| array | $data | Array of data to validate |
| RestException |
Definition at line 986 of file api_mos.class.php.
Referenced by post().
|
private |
Validate the ref field and get the next Number if it's necessary.
Definition at line 1006 of file api_mos.class.php.
| Mos::delete | ( | $id | ) |
Delete MO.
| int | $id | MO ID |
Definition at line 277 of file api_mos.class.php.
References DolibarrApi\_checkAccessToResource().
| Mos::get | ( | $id | ) |
Get properties of a MO object.
Return an array with MO informations
| int | $id | ID of MO |
@url GET {id}
| RestException |
Definition at line 64 of file api_mos.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Mos::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $sqlfilters = '', | |||
| $properties = '' ) |
List Mos.
Get a list of MOs
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
| string | $properties | Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names |
| RestException |
Definition at line 98 of file api_mos.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and forgeSQLFromUniversalSearchCriteria().
| Mos::post | ( | $request_data = null | ) |
Create MO object.
| array | $request_data | Request datas |
Definition at line 193 of file api_mos.class.php.
References _validate(), and checkRefNumbering().
| Mos::produceAndConsume | ( | $id, | |
| $request_data = null ) |
Produce and consume.
Example: { "inventorylabel": "Produce and consume using API", "inventorycode": "PRODUCEAPI-YY-MM-DD", "autoclose": 1, "arraytoconsume": [ { "objectid": "123", – rowid of MoLine "qty": "2", "fk_warehouse": "789" – "0" or empty, if stock change is disabled. } ], "arraytoproduce": [ { "objectid": "456", – rowid of MoLine "qty": "1", "fk_warehouse": "789", "pricetoproduce": "12.3" – optional } ] }
| int | $id | ID of state |
| array | $request_data | Request datas |
@url POST {id}/produceandconsume
Definition at line 711 of file api_mos.class.php.
References dol_now(), and dol_syslog().
| Mos::produceAndConsumeAll | ( | $id, | |
| $request_data = null ) |
Produce and consume all.
Example: { "inventorylabel": "Produce and consume using API", "inventorycode": "PRODUCEAPI-YY-MM-DD", "autoclose": 1, "arraytoconsume": [ "objectid": 123, – ID_of_product "qty": "2", "fk_warehouse": "789" ], "arraytoproduce": [ "objectid": 456, – ID_of_product "qty": "1", "fk_warehouse": "789" ] }
| int | $id | ID of state |
| array | $request_data | Request datas |
@url POST {id}/produceandconsumeall
Definition at line 334 of file api_mos.class.php.
References dol_now(), and dol_syslog().
| Mos::put | ( | $id, | |
| $request_data = null ) |
Update MO.
| int | $id | Id of MO to update |
| array | $request_data | Datas |
Definition at line 227 of file api_mos.class.php.
References DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), and checkRefNumbering().