|
dolibarr
x.y.z
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get properties of a supplier invoice object. More... | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $thirdparty_ids='', $status='', $sqlfilters='') | |
| List invoices. More... | |
| post ($request_data=null) | |
| Create supplier invoice object. More... | |
| put ($id, $request_data=null) | |
| Update supplier invoice. More... | |
| delete ($id) | |
| Delete supplier invoice. More... | |
| validate ($id, $idwarehouse=0, $notrigger=0) | |
| Validate an invoice. More... | |
| getPayments ($id) | |
| Get list of payments of a given supplier invoice. More... | |
| addPayment ($id, $datepaye, $payment_mode_id, $closepaidinvoices, $accountid, $num_payment='', $comment='', $chqemetteur='', $chqbank='') | |
| Add payment line to a specific supplier invoice with the remain to pay as amount. More... | |
| getLines ($id) | |
| Get lines of a supplier invoice. More... | |
| postLine ($id, $request_data=null) | |
| Add a line to given supplier invoice. More... | |
| putLine ($id, $lineid, $request_data=null) | |
| Update a line to a given supplier invoice. More... | |
| deleteLine ($id, $lineid) | |
| Deletes a line of a given supplier invoice. 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 | |
| _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 31 of file api_supplier_invoices.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 713 of file api_supplier_invoices.class.php.
|
private |
Validate fields before create or update object.
| array | $data | Datas to validate |
| RestException |
Definition at line 735 of file api_supplier_invoices.class.php.
| SupplierInvoices::addPayment | ( | $id, | |
| $datepaye, | |||
| $payment_mode_id, | |||
| $closepaidinvoices, | |||
| $accountid, | |||
$num_payment = '', |
|||
$comment = '', |
|||
$chqemetteur = '', |
|||
$chqbank = '' |
|||
| ) |
Add payment line to a specific supplier invoice with the remain to pay as amount.
| int | $id | Id of invoice |
| string | $datepaye | {@from body} Payment date {@type timestamp} |
| int | $payment_mode_id | {@from body} Payment mode ID (look it up via REST GET to /setup/dictionary/payment_types) {@min 1} |
| string | $closepaidinvoices | {@from body} Close paid invoices {@choice yes,no} |
| int | $accountid | {@from body} Bank account ID (look it up via REST GET to /bankaccounts) {@min 1} |
| string | $num_payment | {@from body} Payment number (optional) |
| string | $comment | {@from body} Note (optional) |
| string | $chqemetteur | {@from body} Payment issuer (mandatory if payment_mode_id corresponds to 'CHQ'-payment type) |
| string | $chqbank | {@from body} Issuer bank name (optional) |
@url POST {id}/payments
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
Definition at line 421 of file api_supplier_invoices.class.php.
| SupplierInvoices::delete | ( | $id | ) |
Delete supplier invoice.
| int | $id | Supplier invoice ID |
| RestException | 401 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 288 of file api_supplier_invoices.class.php.
| SupplierInvoices::deleteLine | ( | $id, | |
| $lineid | |||
| ) |
Deletes a line of a given supplier invoice.
| int | $id | Id of supplier invoice |
| int | $lineid | Id of the line to delete |
@url DELETE {id}/lines/{lineid}
| RestException | 400 Bad parameters |
| RestException | 401 Not allowed |
| RestException | 404 Not found |
| RestException | 405 Error |
Definition at line 677 of file api_supplier_invoices.class.php.
| SupplierInvoices::get | ( | $id | ) |
Get properties of a supplier invoice object.
Return an array with supplier invoice information
| int | $id | ID of supplier invoice |
| RestException |
Definition at line 66 of file api_supplier_invoices.class.php.
| SupplierInvoices::getLines | ( | $id | ) |
Get lines of a supplier invoice.
| int | $id | Id of supplier invoice |
@url GET {id}/lines
Definition at line 507 of file api_supplier_invoices.class.php.
| SupplierInvoices::getPayments | ( | $id | ) |
Get list of payments of a given supplier invoice.
| int | $id | Id of SupplierInvoice |
@url GET {id}/payments
| RestException | 400 |
| RestException | 401 |
| RestException | 404 |
| RestException | 405 |
Definition at line 374 of file api_supplier_invoices.class.php.
| SupplierInvoices::index | ( | $sortfield = "t.rowid", |
|
$sortorder = 'ASC', |
|||
$limit = 100, |
|||
$page = 0, |
|||
$thirdparty_ids = '', |
|||
$status = '', |
|||
$sqlfilters = '' |
|||
| ) |
List invoices.
Get a list of supplier invoices
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $thirdparty_ids | Thirdparty ids to filter invoices of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} |
| string | $status | Filter by invoice status : draft | unpaid | paid | cancelled |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" |
| RestException |
Definition at line 101 of file api_supplier_invoices.class.php.
| SupplierInvoices::post | ( | $request_data = null | ) |
Create supplier invoice object.
Note: soc_id = dolibarr_order_id
Example: {'ref': 'auto', 'ref_supplier': '7985630', 'socid': 1, 'note': 'Inserted with Python', 'order_supplier': 1, 'date': '2021-07-28'}
| array | $request_data | Request datas |
| RestException | 401 |
| RestException | 500 System error |
Definition at line 216 of file api_supplier_invoices.class.php.
| SupplierInvoices::postLine | ( | $id, | |
$request_data = null |
|||
| ) |
Add a line to given supplier invoice.
Note: socid = dolibarr_order_id, pu_ht = net price, remise = discount
Example: {'socid': 1, 'qty': 1, 'pu_ht': 21.0, 'tva_tx': 25.0, 'fk_product': '1189', 'product_type': 0, 'remise_percent': 1.0, 'vat_src_code': None}
| int | $id | Id of supplier invoice to update |
| array | $request_data | supplier invoice line data |
@url POST {id}/lines
Definition at line 543 of file api_supplier_invoices.class.php.
| SupplierInvoices::put | ( | $id, | |
$request_data = null |
|||
| ) |
Update supplier invoice.
| int | $id | Id of supplier invoice to update |
| array | $request_data | Datas |
| RestException | 401 |
| RestException | 404 |
Definition at line 248 of file api_supplier_invoices.class.php.
| SupplierInvoices::putLine | ( | $id, | |
| $lineid, | |||
$request_data = null |
|||
| ) |
Update a line to a given supplier invoice.
| int | $id | Id of supplier invoice to update |
| int | $lineid | Id of line to update |
| array | $request_data | InvoiceLine data |
@url PUT {id}/lines/{lineid}
| RestException | 401 Not allowed |
| RestException | 404 Not found |
| RestException | 304 Error |
Definition at line 610 of file api_supplier_invoices.class.php.
| SupplierInvoices::validate | ( | $id, | |
$idwarehouse = 0, |
|||
$notrigger = 0 |
|||
| ) |
Validate an invoice.
| int | $id | Invoice ID |
| int | $idwarehouse | Warehouse ID |
| int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
@url POST {id}/validate
| RestException | 304 |
| RestException | 401 |
| RestException | 404 |
| RestException | 405 |
| RestException | 500 System error |
Definition at line 331 of file api_supplier_invoices.class.php.