mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-25 02:41:26 +01:00
Compare commits
16 Commits
phpstan-ba
...
19.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1b5e024f5 | ||
|
|
a0be2c8890 | ||
|
|
77d7ec8a2b | ||
|
|
cc37c778dc | ||
|
|
722c31d182 | ||
|
|
ba2c173936 | ||
|
|
3c2e85bdb1 | ||
|
|
18f85df343 | ||
|
|
9afa5c713d | ||
|
|
157aa32e0a | ||
|
|
5822887d32 | ||
|
|
aa6ef5ae11 | ||
|
|
c6ed34ebcc | ||
|
|
0beee0bec5 | ||
|
|
c2ae7d2da1 | ||
|
|
71ec381d3e |
@@ -57,7 +57,20 @@ class DolibarrApi
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
|
||||
$this->db = $db;
|
||||
$production_mode = (!getDolGlobalString('API_PRODUCTION_MODE') ? false : true);
|
||||
|
||||
$production_mode = (getDolGlobalString('API_PRODUCTION_MODE') ? true : false);
|
||||
|
||||
if ($production_mode) {
|
||||
// Create the directory Defaults::$cacheDirectory if it does not exist. If dir does not exist, using production_mode generates an error 500.
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
if (!dol_is_dir(Defaults::$cacheDirectory)) {
|
||||
dol_mkdir(Defaults::$cacheDirectory, DOL_DATA_ROOT);
|
||||
}
|
||||
if (getDolGlobalString('MAIN_API_DEBUG')) {
|
||||
dol_syslog("Debug API construct::cacheDirectory=".Defaults::$cacheDirectory, LOG_DEBUG, 0, '_api');
|
||||
}
|
||||
}
|
||||
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
|
||||
@@ -379,6 +379,19 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->atleastonediscount++;
|
||||
}
|
||||
|
||||
// determine category of operation
|
||||
$is_deposit = false;
|
||||
if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
|
||||
if ($reg[1] == 'DEPOSIT') {
|
||||
$is_deposit = true;
|
||||
}
|
||||
}
|
||||
// If DEPOSIT, this line is completely ignored for calculations.
|
||||
if ($is_deposit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// determine category of operation
|
||||
if ($categoryOfOperation < 2) {
|
||||
$lineProductType = $object->lines[$i]->product_type;
|
||||
|
||||
@@ -404,6 +404,19 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$this->atleastonediscount++;
|
||||
}
|
||||
|
||||
// Do not take into account lines of the type “deposit.”
|
||||
$is_deposit = false;
|
||||
if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) {
|
||||
if ($reg[1] == 'DEPOSIT') {
|
||||
$is_deposit = true;
|
||||
}
|
||||
}
|
||||
// If DEPOSIT, this line is completely ignored for calculations.
|
||||
if ($is_deposit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// determine category of operation
|
||||
if ($categoryOfOperation < 2) {
|
||||
$lineProductType = $object->lines[$i]->product_type;
|
||||
|
||||
@@ -230,7 +230,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$bomtmp->ref = $objp->ref;
|
||||
$product = new Product($db);
|
||||
if (!empty($objp->fk_product)) {
|
||||
if (!array_key_exists($product->id, $product_cache)) {
|
||||
if (!array_key_exists($objp->fk_product, $product_cache)) {
|
||||
$resultFetch = $product->fetch($objp->fk_product);
|
||||
if ($resultFetch < 0) {
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
|
||||
Reference in New Issue
Block a user