FIX|Missing require in API : markAsCreditAvailable

Quick fix of a problem I encountered earlier when using `markAsCreditAvailable` API method for invoice routes.
The method was using the `DiscountAbsolute` class without importing it resulting in a 500 HTTP error.
This commit is contained in:
Pierre Penelon 2020-10-05 23:54:37 +02:00 committed by GitHub
parent 73b40828c8
commit 609a29219d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -996,6 +996,8 @@ class Invoices extends DolibarrApi
*/
public function markAsCreditAvailable($id)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
if (!DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}