mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-30 13:21:30 +01:00
Merge pull request #36683 from W1W1-M/new-document-api-generate-builddoc-warehouse
NEW document API builddoc warehouse
This commit is contained in:
@@ -324,6 +324,22 @@ class Documents extends DolibarrApi
|
||||
$templateused = $doctemplate ? $doctemplate : $tmpobject->model_pdf;
|
||||
$result = $tmpobject->generateDocument($templateused, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result <= 0) {
|
||||
throw new RestException(500, 'Error generating document missing doctemplate parameter');
|
||||
}
|
||||
} elseif ($modulepart == 'stock' || $modulepart == 'entrepot') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
|
||||
|
||||
$tmpobject = new Entrepot($this->db);
|
||||
$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
|
||||
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Warehouse not found');
|
||||
}
|
||||
|
||||
$templateused = $doctemplate ? $doctemplate : $tmpobject->model_pdf;
|
||||
$result = $tmpobject->generateDocument($templateused, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
if ($result <= 0) {
|
||||
throw new RestException(500, 'Error generating document missing doctemplate parameter');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user